while (1) { while () { .... } sleep $delay_period; seek(INPUT, 0, 1); }