+ 5
Sleep function compile but it does not work in c++
I tried to add some animation with c++ but sleep function does not work : cout << "solo"; sleep(1); cout<< "learn"; this code print directly sololearn and no wait. is it a sololearn application limitation ? any idea ?
1 Respuesta
+ 3
If I'm not mistaken the Sleep function expects the passed argument in milliseconds, so if 1000 was passed in, there will be a one second delay. In the code the argument is 1 millisecond, that's 1000th a second. I could be wrong though, besides it was under Windows, probably in winbase.h.