# setcpufrequency

Sets CPU frequency value in GHz.

## Syntax

setcpufrequency( freq )

## Output Parameters

freq

  DOUBLE PRECISION. CPU frequency value in GHz.

## Description

The setcpufrequency function sets the CPU frequency in GHz, used then by second /dsecnd functions while converting CPU clocks into seconds. Setting the exact CPU frequency is useful to bypass obtaining a frequency by getcpufrequency.

Initially, CPU frequency value is unset. The CPU frequency value can be set only by setcpufrequency call, or during the first call of getcpufrequency, if setcpufrequency has not been called before. Calling setcpufrequency with a special parameter freq = -1.0 forces the CPU frequency value be unset.

Note that the CPU frequency of your machine is not actually changed when the setcpufrequency subroutine is called.

Parent topic: Timing Functions