diff --git a/library/timing.c b/library/timing.c index 6c1dfa46b1..19ccb9a3fc 100644 --- a/library/timing.c +++ b/library/timing.c @@ -283,15 +283,16 @@ unsigned long get_timer( struct hr_time *val, int reset ) gettimeofday( &offset, NULL ); - delta = ( offset.tv_sec - t->start.tv_sec ) * 1000 - + ( offset.tv_usec - t->start.tv_usec ) / 1000; - if( reset ) { t->start.tv_sec = offset.tv_sec; t->start.tv_usec = offset.tv_usec; + return( 0 ); } + delta = ( offset.tv_sec - t->start.tv_sec ) * 1000 + + ( offset.tv_usec - t->start.tv_usec ) / 1000; + return( delta ); }