timestamp of time(0) at multiple places in a C++ program

The resolution of the time() function isn’t fine grained enough to result in different values to make a different result for each call you make, i.e. the CPU is faster.

You might try to insert std::this_thread::sleep_for calls to check what timing resolution fits for your needs with the hardware and OS you have at hand.

Leave a Comment