Source File modules/ut/timediff.c

    1    |
    2    | #include <timediff.h>
    3    |
    4    | /* difference between two times obtained with UT_store_time */
    5    |
    6    | float UT_timediff( ut_timer_t *begintime, ut_timer_t *endtime )
    7    | {
    8    |   return ( endtime->tv_sec - begintime->tv_sec ) +
    9    |     1e-6 * ( endtime->tv_usec - begintime->tv_usec ) ;
    10   | }
    11   |
    12   | void
    13   | UT_timeget(ut_timer_t *timer)
    14   | {
    15   |   gettimeofday( timer, NULL );
    16   | }