# HG changeset patch # User arpi # Date 1003457781 0 # Node ID e407fc4562f1b28a01f45217ba147c19627a3044 # Parent c26a9eff09938ab414d39a277750281dbdf1f268 sleep stuff moved to linux/timer diff -r c26a9eff0993 -r e407fc4562f1 linux/timer-lx.c --- a/linux/timer-lx.c Fri Oct 19 02:00:45 2001 +0000 +++ b/linux/timer-lx.c Fri Oct 19 02:16:21 2001 +0000 @@ -3,6 +3,19 @@ #include #include +int usec_sleep(int usec_delay) +{ +#if 1 + struct timespec ts; + ts.tv_sec = usec_delay / 1000000; + ts.tv_nsec = (usec_delay % 1000000) * 1000; + return nanosleep(&ts, NULL); +#else + return usleep(usec_delay); +#endif +} + + // Returns current time in microseconds unsigned int GetTimer(){ struct timeval tv;