I need help in pausing the system. I want some kind of timed pause. I have heard of some people using some sort of time functions to pause the system for a allowed amount of time.
Your help is appreciated.
I need help in pausing the system. I want some kind of timed pause. I have heard of some people using some sort of time functions to pause the system for a allowed amount of time.
Your help is appreciated.
#include <dos.h>
main()
{
....
....
delay(1000); //Approx 1 sec.
....
}
Yeah, use delay or some time function like that. There might be a predefined constant that represents one second on all computers so that it will run the same way on AMD 1.4's as it would run on PII 400mhz systems. Not too sure though.
Just noticed "dos.h". That is not too good. Look for something under "time.h" instead.
Last edited by Troll_King; 10-17-2001 at 06:39 PM.
If you are working under UNIX you could have used the following functions:
sleep(num_of_seconds_to_sleep);
usleep(num_of_microseconds_to_sleep);
If you are working under other platform, look for their equivalent in time.h, utime.h or other time related header files.
1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!
i think the easiest way is
#include <conio.h>
and then just use the
getch();
command in the program.
but notice: this is a "press-any-key-to-continue" function...
Dear Dune911,
by using getch() there is no way to implement a time-based delay. getch() will cause an infinite delay unless someone actually enters something on a keyboard.
Cheers
1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!