//Nmb of loops=seconds
float loops=0;
//Status flags of child process
- int status, w;
+ int status;
+ //100ms granularity
+ const int ussleep=50000;
do
{
//Kill the child
- if( loops >= maxtime )
+ if( loops*ussleep/1e6 >= maxtime )
{
if( argVerbose )
printf("Kill child...\n");
}
//Sleep a round
- sleep(1);
+ usleep(ussleep);
loops++;
//Test for child