Jump to content

Perl Programming/Keywords/times

From Wikibooks, open books for an open world
Previous: time Keywords Next: tr

The times keyword

[edit | edit source]

times returns a four-element list that contains the user and the system time in seconds as well as any exited children of it.

Syntax

[edit | edit source]
  times

Examples

[edit | edit source]
The code
($user, $system, $cuser, $csystem) = times;

print ($user, $system, $cuser, $csystem) . "\n";
print "\n";
print "'" . $user . "', '" . $system . "', '" . $cuser . "', '" . $csystem . "'\n";
prints first consecutively the user, system time, and the exited children (non did exist), then with separated with a comma:
00.01500
'0', '0.015', '0', '0'

See also

[edit | edit source]
gmtime localtime time times utime
Previous: time Keywords Next: tr