If you actually want to write a delay function you can do it easily with the clock function found in time.h. For example,
void delay( int seconds )
{
clock_t start = clock();
while( clock() < start + seconds * CLOCKS_PER_SEC );
}
...
delay(5); // Delay for 5 seconds.
Exceter
Main Topics
Browse All Topics





by: akshayxxPosted on 2003-06-08 at 05:11:12ID: 8676073
that means u dont want to use the standard function sleep() ??
then u got to use combination of alarm() and SIGALRM signal handler..