start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: time Chapter 5
Function Reference
Next: Reference: truncate
 

times

times

Returns a four-element list giving the user and system CPU times, in seconds (possibly fractional), for this process and for the children of this process:

($user, $system, $cuser, $csystem) = times;
For example, to time the execution speed of a section of Perl code:
$start = (times)[0]; ... $end = (times)[0]; printf "that took %.2f CPU seconds\n", $end - $start;


Previous: Reference: time Perl in a Nutshell Next: Reference: truncate
Reference: time Book Index Reference: truncate

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.