while (1) { # Do stuff here; sleep ( 3600 - time() % 3600 ); }