in reply to Scheduling at NT
while ( ($t = time()) < $targettime ) { sleep($targettime - $t); } [download]