Remove get_time_ms() and use get_time()
This commit is contained in:
parent
0f4db94ea1
commit
88c2434e13
@ -27,19 +27,11 @@ busywork(long loops)
|
|||||||
for (volatile long j = 0; j < loops; j++);
|
for (volatile long j = 0; j < loops; j++);
|
||||||
}
|
}
|
||||||
|
|
||||||
static double
|
|
||||||
get_time_ms(void)
|
|
||||||
{
|
|
||||||
struct timespec ts;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
|
||||||
return (double) ts.tv_sec + (double) ts.tv_nsec * 1.0e-9;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dummy_work(double ms)
|
dummy_work(double ms)
|
||||||
{
|
{
|
||||||
double end = get_time_ms() + ms * 1e-3;
|
double end = get_time() + ms * 1e-3;
|
||||||
while (get_time_ms() < end);
|
while (get_time() < end);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user