Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeschmitt-tr committed Aug 12, 2024
1 parent 110189a commit 2e05419
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/xs_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,12 @@ void log(logging::Level level, const char * fmt, ...)
break;
}

auto time_now = std::chrono::system_clock::now().time_since_epoch();
auto time_s = std::chrono::duration_cast<std::chrono::seconds>(time_now);
auto duration = std::chrono::system_clock::now().time_since_epoch();
double seconds = std::chrono::duration<double>(duration).count();

msg = msg
+ " ["
+ std::to_string(time_s.count()) // seconds
+ "."
+ std::to_string((time_now - time_s).count()) // nanoseconds
+ std::to_string(seconds)
+ "] ";

va_list args;
Expand Down

0 comments on commit 2e05419

Please sign in to comment.