is there a way to stop the program for an alotted time period without making it say
press any key to continue?
email me
[email protected]
Printable View
is there a way to stop the program for an alotted time period without making it say
press any key to continue?
email me
[email protected]
you use the sleep(milliseconds) function in <windows.h>. It will pause the program for the amount of milliseconds without any "Press any key.." or anything.
Have fun
Hi!
If you would like to pause a very short amount of time you could try:
-----------------------
#include <time.h>
-----------------------
tmrstart=(clock()/(double) CLOCKS_PER_SEC)+0.02; '0.02' is the pause value
// A small break
while((clock()/(double) CLOCKS_PER_SEC)<tmrstart){
;
}
/Johan
or not the prettiest way but yuo could also create a nested for loop which would delay the program, but again not the most efficient
for(int k = 0; k<10000; k++)
{
for (int j = 0;j<10000;j++)
{}
{
and modify the 10,000 according to how much delay you want
>>> you use the sleep(milliseconds) function in <windows.h>.
The function is Sleep() not sleep(), (S not s). If you are not using Windows it may be sleep() or wait() or alarm() or possibly something else.