systemtime: Add function wrapping platform sleep function

Adds systemtime_msleep() which sleeps for a number of milliseconds.
This wraps Sleep() on windows and usleep() on other platforms.
This commit is contained in:
Jon Lund Steffensen
2014-12-28 13:13:21 -05:00
parent 4adf25952f
commit ba422bd78e
3 changed files with 17 additions and 8 deletions
+11
View File
@@ -68,3 +68,14 @@ systemtime_get_time(double *t)
return 0;
}
/* Sleep for a number of milliseconds. */
void
systemtime_msleep(unsigned int msecs)
{
#ifndef _WIN32
usleep(msecs*1000);
#else
Sleep(msecs);
#endif
}