|
- #include <sys/time.h>
-
- #include "utils.hpp"
-
-
- int64_t time_us() {
- /*struct timeval tv_now;
- gettimeofday(&tv_now, NULL);
- return (int64_t)tv_now.tv_sec * 1000000L + (int64_t)tv_now.tv_usec;*/
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- return (int64_t)ts.tv_sec * 1000000L + (int64_t)ts.tv_nsec / 1000L;
- }
|