diff options
-rw-r--r-- | examples/unix/platform_utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/unix/platform_utils.c b/examples/unix/platform_utils.c index 777d56b..1f3ff43 100644 --- a/examples/unix/platform_utils.c +++ b/examples/unix/platform_utils.c @@ -34,11 +34,8 @@ * ***** END LICENSE BLOCK ***** */ -/* For usleep */ -#define _BSD_SOURCE - #include <stdint.h> - +#include <time.h> #include <sys/time.h> #include <unistd.h> @@ -51,5 +48,8 @@ uint64_t now_microseconds(void) void microsleep(int usec) { - usleep(usec); + struct timespec req; + req.tv_sec = 0; + req.tv_nsec = 1000 * usec; + nanosleep(&req, NULL); } |