blob: 48d9d27172693ab09da6c54b841d9c310209c2e9 [file] [log] [blame]
Amit Pundird477f822020-02-07 22:26:08 +05301#include <string.h>
2#include <stdio.h>
3#include <unistd.h>
4#include <sys/time.h>
5
6#include "util.h"
7
8uint64_t time_ms(void)
9{
10 struct timeval tv;
11 gettimeofday(&tv, NULL);
12 return (uint64_t)tv.tv_sec*1000 + tv.tv_usec/1000;
13}
14
15void util_sleep(int ms)
16{
17 usleep(ms * 1000);
18}