my $t0=time(); while(1){ # do processing # .. # sleep till next polling interval. sleep 60-(time()-$t0)%60; }