isearch/comm/timestamp.h

17 lines
309 B
C
Raw Normal View History

2021-03-19 18:38:34 +08:00
#ifndef __TTC_TIMESTAMP_H__
#define __TTC_TIMESTAMP_H__
#include <stdint.h>
#include <time.h>
#include <sys/time.h>
static inline int64_t GET_TIMESTAMP(void) {
struct timeval tv;
gettimeofday(&tv, NULL);
return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}
#define TIMESTAMP_PRECISION 1000000ULL
#endif