PDF version (NAG web site

, 64-bit version, 64-bit version)

# NAG Toolbox: nag_time_cpu (x05ba)

## Purpose

nag_time_cpu (x05ba) returns the amount of processor time used since an unspecified previous time.

## Syntax

## Description

nag_time_cpu (x05ba) 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, nag_time_cpu (x05ba) returns the value zero.

## References

None.

## Parameters

### Compulsory Input Parameters

None.

### Optional Input Parameters

None.

### Input Parameters Omitted from the MATLAB Interface

None.

### Output Parameters

- 1:
result – double scalar
The result of the function.

## Error Indicators and Warnings

None.

## Accuracy

The accuracy of the value returned depends on the accuracy of the system clock on the host machine.

## Further Comments

Since the value returned by nag_time_cpu (x05ba) 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 nag_time_cpu (x05ba). The amount of processor time that has elapsed between two calls of nag_time_cpu (x05ba) can be simply calculated as the earlier value subtracted from the later value.

## Example

Open in the MATLAB editor:
nag_time_cpu_example

**function nag_time_cpu_example**
[result] = nag_time_cpu

result =
5.4812

Open in the MATLAB editor:
x05ba_example

**function x05ba_example**
[result] = x05ba

result =
5.4592

PDF version (NAG web site

, 64-bit version, 64-bit version)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013