Use the WINAPI Sleep function

This commit is contained in:
Matt Clarkson 2015-03-27 13:38:13 +00:00
parent 6bc54ba028
commit 65a5ebd638

View File

@ -19,10 +19,14 @@
#include "internal_macros.h"
#ifdef OS_WINDOWS
#include <Windows.h>
#endif
namespace benchmark {
#ifdef OS_WINDOWS
// Window's _sleep takes milliseconds argument.
void SleepForMilliseconds(int milliseconds) { _sleep(milliseconds); }
// Window's Sleep takes milliseconds argument.
void SleepForMilliseconds(int milliseconds) { Sleep(milliseconds); }
void SleepForSeconds(double seconds) {
SleepForMilliseconds(static_cast<int>(kNumMillisPerSecond * seconds));
}