my( $time, $units ) = m[([\d.]+) (ms|us|secs)]; my $scaler = $units eq 'us' ? 0.1 : $units eq 'secs' ? 1000 : 1; $time *= $scaler;