mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
refactor: Replace GetTimeMicros by SystemClock
This commit is contained in:
@@ -349,11 +349,12 @@ std::string BCLog::Logger::LogTimestampStr(const std::string& str)
|
||||
return str;
|
||||
|
||||
if (m_started_new_line) {
|
||||
int64_t nTimeMicros = GetTimeMicros();
|
||||
strStamped = FormatISO8601DateTime(nTimeMicros/1000000);
|
||||
const auto now{SystemClock::now()};
|
||||
const auto now_seconds{std::chrono::time_point_cast<std::chrono::seconds>(now)};
|
||||
strStamped = FormatISO8601DateTime(TicksSinceEpoch<std::chrono::seconds>(now_seconds));
|
||||
if (m_log_time_micros) {
|
||||
strStamped.pop_back();
|
||||
strStamped += strprintf(".%06dZ", nTimeMicros%1000000);
|
||||
strStamped += strprintf(".%06dZ", Ticks<std::chrono::microseconds>(now - now_seconds));
|
||||
}
|
||||
std::chrono::seconds mocktime = GetMockTime();
|
||||
if (mocktime > 0s) {
|
||||
|
||||
Reference in New Issue
Block a user