use Benchmark qw( cmpthese ) ; my $wait = -34; cmpthese( -2, { a=>sub{ $wait = $wait < 0 ? 0 : $wait ; $wait = -34; }, b=>sub{ if ($wait < 0 ){ $wait = 0}; $wait = -34; }, c=>sub{ $wait = 0 unless $wait > 0; $wait = -34; }, d=>sub{ $wait = 0 unless abs($wait); $wait = -34; },