use Time::Convert; # skip other code my $tmstr = timestr($difference); $tmstr =~ /(\d+) wallclock secs/; my $convert = new Time::Convert; my $actual = $convert->ConvertSecs($1); print( "It took $actual\n" );