blob: 48d9d27172693ab09da6c54b841d9c310209c2e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include "util.h"
uint64_t time_ms(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
return (uint64_t)tv.tv_sec*1000 + tv.tv_usec/1000;
}
void util_sleep(int ms)
{
usleep(ms * 1000);
}
|