Fumofumotris/source/game/gametime.c
Julia 8ad3bf1f22 gaming
th j
2024-04-22 17:13:13 -05:00

20 lines
333 B
C

#include "gametime.h"
#include <time.h>
#define ONE_E_9 1000000000
Time TimeNow()
{
struct timespec ts;
timespec_get(&ts, TIME_UTC);
return ts.tv_nsec + ts.tv_sec * ONE_E_9;
}
double TimeNowD()
{
struct timespec ts;
timespec_get(&ts, TIME_UTC);
return ts.tv_sec + (double)ts.tv_nsec / 1000000000.0;
}