mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Fixed stopwatch test
This commit is contained in:
parent
68e71cfc49
commit
2a4aa8f2d1
@ -12,7 +12,7 @@ TEST_CASE("stopwatch1", "[stopwatch]") {
|
|||||||
std::this_thread::sleep_for(wait_ms);
|
std::this_thread::sleep_for(wait_ms);
|
||||||
auto stop = clock::now();
|
auto stop = clock::now();
|
||||||
auto diff_ms = std::chrono::duration_cast<milliseconds>(stop - start);
|
auto diff_ms = std::chrono::duration_cast<milliseconds>(stop - start);
|
||||||
REQUIRE(sw.elapsed() >= diff_ms);
|
REQUIRE(sw.elapsed() >= diff_ms - milliseconds(1));
|
||||||
REQUIRE(sw.elapsed() <= diff_ms + tolerance_ms);
|
REQUIRE(sw.elapsed() <= diff_ms + tolerance_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user