using infinite loop with epoch chrono method to get timestamp, cpu heats up to 90 degrees

Code below:

auto miliseconds = duration_cast(system_clock::now().time_since_epoch()).count(); bool todayDayStamp = false;

miliseconds = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();

cout << miliseconds << endl;

is there any more convenient way to get timestamp with infinite loop? my computer smells like hot dog hair which scares me and I need to get the timestamp with infinite loop. Kindly advise
Let the CPU sleep for a while on each iteration.

https://en.cppreference.com/w/cpp/thread/sleep_for
Last edited on
Topic archived. No new replies allowed.