Home Segments Index Top Previous Next

565: Mainline

So that your program will pause a little after each attack on the test.data file, you insert a call to the sleep function, which is found in C's standard library. The argument you supply to sleep is the number of seconds that you want your program to pause. In the following example, you ask for a 5-minute pause:

while (1) { 
  ... 
  sleep (300); 
} 

Whenever you use sleep, you must announce your intention by including the following line in your program:

#include