C++ get current time(to millisecond)

Jaime Lin
Apr 8, 2021

Sometimes we need t to trace the execution order to make sure the program runs as our expectations, especially the multi-thread programs. We all know ctime is a great function to help us get the current time. It can convert current time to string. But it seems insufficient if you’re handling millisecond cases.

Here we can leverage boost library to acquire subtle time.

If you like this post, you can buy me a coffee! :)

Reference:

--

--

Jaime Lin

From Taiwan, a beautiful island. Learning English and sharing code experience.