Use CLOCK_REALTIME
This commit is contained in:
4
mud.c
4
mud.c
@@ -175,9 +175,9 @@ static
|
|||||||
uint64_t mud_now (struct mud *mud)
|
uint64_t mud_now (struct mud *mud)
|
||||||
{
|
{
|
||||||
uint64_t now;
|
uint64_t now;
|
||||||
#if defined CLOCK_MONOTONIC
|
#if defined CLOCK_REALTIME
|
||||||
struct timespec tv;
|
struct timespec tv;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &tv);
|
clock_gettime(CLOCK_REALTIME, &tv);
|
||||||
now = tv.tv_sec*MUD_ONE_SEC+tv.tv_nsec/MUD_ONE_MSEC;
|
now = tv.tv_sec*MUD_ONE_SEC+tv.tv_nsec/MUD_ONE_MSEC;
|
||||||
#else
|
#else
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|||||||
Reference in New Issue
Block a user