use AnyEvent; my $timer_once = AE::timer 0.5, 0.5, sub { print 'too late' }; for (my $x = 0; $x < 200000000; $x++) { }