21 lines
308 B
C
21 lines
308 B
C
|
#include <time.h>
|
||
|
#include <stdbool.h>
|
||
|
|
||
|
#ifdef _WIN32
|
||
|
#include "win.h"
|
||
|
#endif
|
||
|
|
||
|
double GetTime()
|
||
|
{
|
||
|
struct timespec ts;
|
||
|
timespec_get(&ts, TIME_UTC);
|
||
|
|
||
|
return ts.tv_sec + (double)ts.tv_nsec / 1000000000.0;
|
||
|
}
|
||
|
|
||
|
bool Wait(double seconds)
|
||
|
{
|
||
|
#ifdef _WIN32
|
||
|
return WindowsWait(seconds);
|
||
|
#endif
|
||
|
}
|