HP MLIB User's Guide Vol. 2 7th Ed.
604 HP MLIB User’s Guide
Miscellaneous subprograms Measure CPU time
Miscellaneous subprograms
The following sections describe miscellaneous subprograms included with
VECLIB.
Name CPUTIME
Measure CPU time
Purpose CPUTIME returns the total amount of CPU time used by a process. Both user
time and system time are included. The time unit is seconds and the resolution
of the timer is 0.01 seconds. CPUTIME also makes it easy to time a segment of
code in a program. In a multithreaded execution, CPUTIME returns the sum of
the CPU time from all the threads of the process, not the individual CPU time
of a thread.
Usage VECLIB, VECLIB8, LAPACK, and ScaLAPACK:
Input tzero Starting time of a time interval you wish to measure.
See Notes for details.
time Elapsed CPU time in seconds minus tzero.
Notes To measure the total CPU time used by a program, use tzero = 0.0.
To measure the amount of CPU time used by a segment of code in a program,
use CPUTIME before and after the segment as follows:
REAL*4 CPUTIME, time, tzero
time = CPUTIME(tzero)
REAL*4 CPUTIME, time, tzero
tzero = CPUTIME(0.0)
segment of code to be timed
time = CPUTIME(tzero)