Can c++ be used for delay generation? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can c++ be used for delay generation?

Just like embedded c can generate delay. Can C++ do?

13th Aug 2016, 11:24 AM
Usman
Usman - avatar
3 Answers
+ 1
The windows.h header has the Sleep(MILLISECONDS); function, though as the header suggests it's only going to work on a Windows OS.
13th Aug 2016, 1:21 PM
Cohen Creber
Cohen Creber - avatar
0
Win32: Sleep(milliseconds) is what you what unix: usleep(microseconds) is what you want. sleep() only takes a number of seconds which is often too long.
13th Aug 2016, 3:07 PM
Tushar Chetan
Tushar Chetan - avatar
0
of course yes
13th Aug 2016, 7:43 PM
Oyekunle Oyegunle
Oyekunle Oyegunle - avatar