my $next_time = time()*60; while(1) { DoEvents; sleep(1); if (time() >= $next_time) { $next_time += 60; your_callback(); } }