Need to cast duration to system_clock resolution.

pull/3531/head
Doug Nazar 2022-07-16 10:03:54 +00:00
parent 3c5e44dfe5
commit df414fc028
1 changed files with 2 additions and 1 deletions

View File

@ -36,8 +36,9 @@ std::string SystemTimePointToString(SystemTimePoint tp) {
}
std::string TimePointToString(TimePoint tp) {
const auto tp_dur = std::chrono::duration_cast<std::chrono::system_clock::duration>(tp - std::chrono::steady_clock::now());
time_t tp_sec = std::chrono::system_clock::to_time_t(
std::chrono::system_clock::now() + (tp - std::chrono::steady_clock::now()));
std::chrono::system_clock::now() + tp_dur);
Microseconds now_frac = std::chrono::duration_cast<Microseconds>(
tp.time_since_epoch() - std::chrono::duration_cast<Seconds>(tp.time_since_epoch()));