cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
using infinite loop with epoch chrono me
using infinite loop with epoch chrono method to get timestamp, cpu heats up to 90 degrees
Mar 21, 2023 at 10:13pm UTC
jNc
(66)
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
Mar 21, 2023 at 10:23pm UTC
Peter87
(11238)
Let the CPU sleep for a while on each iteration.
https://en.cppreference.com/w/cpp/thread/sleep_for
Last edited on
Mar 21, 2023 at 10:24pm UTC
Topic archived. No new replies allowed.