0

I'm writing multithreading app on C++ and I need logging with timestamps to workout data races synchronization etc. This means that I need to log time with milliseconds at least. I looked all over the internet to find the way just to print std::chrono::high_resolution_clock::time_point in a way like 14:08:12.132

I know that it should be trivial. I will appreciate for the working solution.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Yura
  • 969
  • 14
  • 33
  • 1
    Are you aware of [this thread](https://stackoverflow.com/questions/15777073/how-do-you-print-a-c11-time-point)? – lubgr Jan 24 '19 at 13:44
  • 1
    I don't understand your reasoning about multi-threading BTW. – Jarod42 Jan 24 '19 at 13:45
  • 2
    Seems like an XY problem to me. You are trying to solve a problem 'Y' and then apply the solution to solve 'X'. Nevertheless, I really don't think logs with timestamps are the proper solution to your 'X' problem. – ProXicT Jan 24 '19 at 13:48
  • the multithreading part is to check watchdog thread work and work threads ticking – Yura Jan 24 '19 at 13:49
  • @lubgr I saw that topic. But the only explicit answer is to use 3rd party library. – Yura Jan 24 '19 at 14:08

0 Answers0