32#if defined(__windows__)
41 ft.QuadPart = -(10 * usec);
43 timer = CreateWaitableTimer(NULL, TRUE, NULL);
44 SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0);
45 WaitForSingleObject(timer, INFINITE);
64 printf(
"Press enter to continue...");
66 int n = scanf(
"%c", k);
70 }
else if (error != 0) {
71 n_log(
LOG_ERR,
"error %s when waiting for a key !", strerror(error));
88#if defined(__windows__)
89 if (QueryPerformanceFrequency((LARGE_INTEGER*)&timer->freq) == 0)
91 if (QueryPerformanceCounter(&timer->
startTime) == 0)
94 if (gettimeofday(&timer->
startTime, 0) != 0)
109 QueryPerformanceCounter((LARGE_INTEGER*)&timer->
currentTime);
130 QueryPerformanceCounter((LARGE_INTEGER*)&timer->
currentTime);
151 QueryPerformanceCounter((LARGE_INTEGER*)&timer->
currentTime);
#define __n_assert(__ptr, __ret)
macro to assert things
#define n_log(__LEVEL__,...)
Logging function wrapper to get line and func.
#define LOG_DEBUG
debug-level messages
#define LOG_ERR
error conditions
struct timeval startTime
start time
time_t delta
time since last poll
struct timeval currentTime
current time
void u_sleep(unsigned int usec)
wrapper around usleep for API consistency
int start_HiTimer(N_TIME *timer)
Initialize or restart from zero any N_TIME HiTimer.
time_t get_usec(N_TIME *timer)
Poll any N_TIME HiTimer, returning usec, and moving currentTime to startTime.
time_t get_msec(N_TIME *timer)
Poll any N_TIME HiTimer, returning msec, and moving currentTime to startTime.
time_t get_sec(N_TIME *timer)
Poll any N_TIME HiTimer, returning sec, and moving currentTime to startTime.
void PAUSE(void)
make a pause in a terminal