Use actual time since the current log window started for log messages.

This commit is contained in:
Christian Speckner 2018-12-15 00:15:44 +01:00
parent 5b0b8cd5cb
commit d5d9618def
1 changed files with 5 additions and 1 deletions

View File

@ -87,12 +87,16 @@ void StaggeredLogger::_log()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StaggeredLogger::logLine() void StaggeredLogger::logLine()
{ {
high_resolution_clock::time_point now = high_resolution_clock::now();
Int64 millisecondsSinceLastLogEvent =
duration_cast<duration<Int64, std::milli>>(now - myCurrentIntervalStartTimestamp).count();
stringstream ss; stringstream ss;
ss ss
<< currentTimestamp() << ": " << currentTimestamp() << ": "
<< myMessage << myMessage
<< " (" << myCurrentEventCount << " times in " << " (" << myCurrentEventCount << " times in "
<< myCurrentIntervalSize << " milliseconds" << millisecondsSinceLastLogEvent << " milliseconds"
<< ")"; << ")";
myLogger(ss.str()); myLogger(ss.str());