NAG Library Routine Document
x05baf returns the amount of processor time used since an unspecified previous time, via the routine name.
|Real (Kind=nag_wp)||:: ||x05baf|
x05baf returns the number of seconds of processor time used since some previous time. The previous time is system dependent, but may be, for example, the time the current job or the current program started running.
If the system clock of the host machine is inaccessible for any reason, x05baf returns the value zero.
Error Indicators and Warnings
The accuracy of the value returned depends on the accuracy of the system clock on the host machine.
Parallelism and Performance
x05baf is not threaded in any implementation.
Since the value returned by x05baf is the amount of processor time since some unspecified earlier time, no significance should be placed on the value other than as a marker to be compared with some later figure returned by x05baf. The amount of processor time that has elapsed between two calls of x05baf can be simply calculated as the earlier value subtracted from the later value.
This example makes an initial call to x05baf. In a loop it performs some computations and makes another call to x05baf; the difference between the value from this call and the initial is used to track the time taken by those computations. The loop is exited if an allotted time limit is exceeded.
Program Text (x05bafe.f90)
Program Results (x05bafe.r)