mirror of
https://github.com/google/benchmark.git
synced 2025-01-30 05:40:15 +08:00
Use the WINAPI Sleep
function
This commit is contained in:
parent
6bc54ba028
commit
65a5ebd638
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user