k1x-tcm/time_us.c
2024-12-16 10:04:11 +08:00

14 lines
No EOL
247 B
C

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
long long getus(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
return ((long long)tv.tv_sec * 1000000 + tv.tv_usec);
}