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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user