openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/dbus/1.12.16-r0/dbus-1.12.16/dbus/dbus-sysdeps-unix.c
void _dbus_get_monotonic_time(long* tv_sec, long* tv_usec)
{
#ifdef HAVE_MONOTONIC_CLOCK
    struct timespec ts;
    clock_gettime(CLOCK_MONOTONIC, &ts);

    if (tv_sec)
        *tv_sec = ts.tv_sec;
    if (tv_usec)
        *tv_usec = ts.tv_nsec / 1000;
#else
    struct timeval t;

    gettimeofday(&t, NULL);

    if (tv_sec)
        *tv_sec = t.tv_sec;
    if (tv_usec)
        *tv_usec = t.tv_usec;
#endif
}
/**
 * Get current time, as in gettimeofday(). Use the monotonic clock if
 * available, to avoid problems when the system time changes.
 *
 * @param tv_sec return location for number of seconds
 * @param tv_usec return location for number of microseconds
 */
Get current time, as in gettimeofday(). Use the monotonic clock if
available, to avoid problems when the system time changes.

@param tv_sec return location for number of seconds
@param tv_usec return location for number of microseconds
Get current time as in gettimeofday () . Use the monotonic clock if available to avoid problems when the system time changes . @param tv_sec return location for number of seconds @param tv_usec return location for number of microseconds
void _dbus_get_monotonic_time(long* tv_sec, long* tv_usec)
{
#ifdef HAVE_MONOTONIC_CLOCK
    struct timespec ts;
    clock_gettime(CLOCK_MONOTONIC, &ts);
    if (tv_sec)
        *tv_sec = ts.tv_sec;
    if (tv_usec)
        *tv_usec = ts.tv_nsec / 1000;
#else
    struct timeval t;
    gettimeofday(&t, NULL);
    if (tv_sec)
        *tv_sec = t.tv_sec;
    if (tv_usec)
        *tv_usec = t.tv_usec;
#endif
}
void _dbus_get_monotonic_time ( long * tv_sec , long * tv_usec ) { #ifdef HAVE_MONOTONIC_CLOCK struct timespec ts ; clock_gettime ( CLOCK_MONOTONIC , & ts ) ; if ( tv_sec ) * tv_sec = ts . tv_sec ; if ( tv_usec ) * tv_usec = ts . tv_nsec / 1000 ; #else struct timeval t ; gettimeofday ( & t , NULL ) ; if ( tv_sec ) * tv_sec = t . tv_sec ; if ( tv_usec ) * tv_usec = t . tv_usec ; #endif }
Get current time, as in gettimeofday().
Get current time as in gettimeofday () .