my $t1 = time(); ... ...somecode... ... my $t2 = time(); print "It took ".(int(($t2-$t1)/3600)).':'.(int((($t2-$t1) % 3600)/60)).'.'.(int(($t2-$t1) % 60))."\n";