Commit 539da112 by Dominic Hamon

Merge pull request #209 from BillyONeal/fix-appveyor

Fix appveyor's older MSVC++ builds by working around 2015 Update 2 bugfix
parents 354b14d1 df9ab801
......@@ -186,7 +186,8 @@ static void BM_ManualTiming(benchmark::State& state) {
while (state.KeepRunning()) {
auto start = std::chrono::high_resolution_clock::now();
// Simulate some useful workload with a sleep
std::this_thread::sleep_for(sleep_duration);
std::this_thread::sleep_for(std::chrono::duration_cast<
std::chrono::nanoseconds>(sleep_duration));
auto end = std::chrono::high_resolution_clock::now();
auto elapsed =
......
......@@ -9,14 +9,11 @@ void BM_basic(benchmark::State& state) {
}
void BM_basic_slow(benchmark::State& state) {
int milliseconds = state.range_x();
std::chrono::duration<double, std::milli> sleep_duration {
static_cast<double>(milliseconds)
};
std::chrono::milliseconds sleep_duration(state.range_x());
while (state.KeepRunning()) {
std::this_thread::sleep_for(sleep_duration);
std::this_thread::sleep_for(
std::chrono::duration_cast<std::chrono::nanoseconds>(sleep_duration)
);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment