Skip to content

Commit 17fd66a

Browse files
Make current_time() test less sensitive to implementation
1 parent 88be35c commit 17fd66a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libtrn/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ void verify_sig()
484484
double current_time()
485485
{
486486
using namespace std::chrono;
487-
auto result{duration_cast<milliseconds>(high_resolution_clock::now().time_since_epoch()).count()};
487+
auto result{duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count()};
488488
return static_cast<double>(result) / 1000.0;
489489
}
490490

tests/test_current_time.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ TEST(TestCurrentTime, msAccuracy)
99
{
1010
using namespace std::chrono_literals;
1111
const double start{current_time()};
12-
std::this_thread::sleep_for(100ms);
12+
std::this_thread::sleep_for(150ms);
1313

1414
const double now{current_time()};
1515

0 commit comments

Comments
 (0)