|
| mathueie (22) | |
Hi, I am using ubuntu linux. How to make a time delay of a more than 30min using C++. | |
Last edited on | |
| computerquip (876) | |
| ...What? "How to make a time delay of a more than 30min using C++." It sounds like you want a timer but I'm not exactly sure. :/ | |
Last edited on | |
| writetonsharma (832) | |
| you can use sleep(). it take time in milliseconds.. so calculate how much you need to pass.. it will be around.. (1000 * 60 * 30) | |
| computerquip (876) | |
| I thought sleep only worked in Windows? | |
| kbw (1510) | |
| Sleep is the Windows version, the parameter is milli-seconds. sleep is the Unix version, the parameter is seconds. | |
| Duoas (3489) | |||
usleep() is the *nix equivalent, the argument is in micro-seconds (10-6).
http://www.google.com/search?btnI=1&q=msdn+sleep http://linux.die.net/man/3/usleep Just to be complete. ;-) | |||
| mathueie (22) | |
Hi Thanks friends...... | |
| Denis (178) | |
| Sorry for late reply #include <ctime> inline void mySleep(clock_t sec) // clock_t is a like typedef unsigned int clock_t. Use clock_t instead of integer in this context { clock_t start_time = clock(); clock_t end_time = sec * 1000 + start_time while(clock() != end_time); } | |
Last edited on | |
This topic is archived - New replies not allowed.
