This POSIX function returns the elapsed realtime since system startup, the user and system time of the process and the user and system time of the child processes. All times are returned in clock tics.
#!/usr/bin/perl
#
use POSIX;
($realtime, $user, $system, $cuser, $csystem) = POSIX::times();
$seconds = $realtime * 0.01;
print <<EOF;
POSIX::times() output:
Real time since system startup
tics: $realtime
seconds: $seconds
Process time [tics]
user: $user
system: $system
Child processes [tics]
user: $user
system: $system
EOF
;
exit 0;