actube/src/cw/timer_inline.c
7u83@mail.ru 14de235c5c libcs compiles with -ansi option now
FossilOrigin-Name: afeca48ac2e33dace533047329ea48224ee5e4bfd4e83449f335d0a022a67215
2018-03-02 12:36:03 +00:00

16 lines
328 B
C

#include "timer.h"
/**
* Get lap time. (stop watch)
* @param tv pointer to a clock variable defined with #CW_CLOCK_DEFINE
* @return lap time in seconds.
*/
double cw_clock_lap(struct timeval *tv)
{
struct timeval lap;
gettimeofday(&lap, NULL);
return (cw_timevaltodouble(&lap) - cw_timevaltodouble(tv)) / 1000000.0;
}