use POSIX; sub mytime { my ($clock_ticks) = POSIX::sysconf(&POSIX::_SC_CLK_TCK); return ((POSIX::times())[0] / $clock_ticks); }