+ 4

How to use delay option in c programing in code block ?

16th Nov 2016, 8:45 AM
Manthan
Manthan - avatar
4 odpowiedzi
+ 2
add this header " #include <windows.h> " and use " Sleep(1000) " in your code.. this makes delay of 1000 ms
16th Nov 2016, 3:43 PM
Majid Barzegar
+ 2
thank you
21st Nov 2016, 5:09 AM
Manthan
Manthan - avatar
+ 1
1000ms means 1s right! then why can't we simply write sleep(1) instead of sleep(1000)? Is is that the sleep() function accepts time in units of milli seconds ?
21st Nov 2016, 9:35 AM
Chitransh Vishwakarma
Chitransh Vishwakarma - avatar
+ 1
yes chitransh.. you must pass the time in milliseconds to this function.. also be careful to write that with capital S like "Sleep(500)"
22nd Nov 2016, 8:34 AM
Majid Barzegar