Carp/core/bench.h

9 lines
200 B
C
Raw Normal View History

2017-10-25 14:07:34 +03:00
#include <sys/time.h>
// TODO: use timespecs for better accuracy!
2017-10-25 14:07:34 +03:00
double get_MINUS_time_MINUS_elapsed() {
struct timeval tv;
gettimeofday(&tv, NULL);
return 1000000 * tv.tv_sec + tv.tv_usec;
2017-10-25 14:07:34 +03:00
}