Need to cast duration to system_clock resolution.
parent
3c5e44dfe5
commit
df414fc028
|
@ -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()));
|
||||
|
|
Loading…
Reference in New Issue