Debugging colored, cool
FossilOrigin-Name: b62ab94004ae914a6c042383ef399141a1a82e49408b6ae3b1422ba3c72733b1
This commit is contained in:
13
src/cw/cw_clock_lap.c
Normal file
13
src/cw/cw_clock_lap.c
Normal file
@ -0,0 +1,13 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user