x05baf returns the amount of processor time used since an unspecified previous time, via the routine name.
2Specification
Fortran Interface
Function x05baf (
)
Real (Kind=nag_wp)
::
x05baf
C Header Interface
#include <nag.h>
double
x05baf_ ()
C++ Header Interface
#include <nag.h>
extern "C" {
double
x05baf_ ()
}
The routine may be called by the names x05baf or nagf_time_cpu.
3Description
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.
4References
None.
5Arguments
None.
6Error Indicators and Warnings
None.
7Accuracy
The accuracy of the value returned depends on the accuracy of the system clock on the host machine.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
x05baf is not threaded in any implementation.
9Further Comments
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.
10Example
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.