CPU_CLOCK@

Platform

Win32

Purpose

To get the number of CPU clocks since start up.

Syntax

REAL (KIND=3) FUNCTION CPU_CLOCK@()

Description

This routine is usually used to time a process as shown in the example below. The routine is coded inline using the Pentium assembly instruction XRDTSC. It has its own time penalty of the order of 20 CPU clocks.

Notes

The function CPU_CLOCK@ is not available for 64 bit applications and has been replaced by the function RDTSC_VAL@ that takes no arguments and returns an INTEGER*8 result.

See also

CPU_TIME, DCLOCK@, HIGH_RES_CLOCK@, SECONDS_SINCE_1980@.

Example

REAL(3) START,FINISH
START= CPU_CLOCK@()
! some calculation. . .
FINISH= CPU_CLOCK@()
PRINT *,FINISH-START,'clocks taken'

 

 

Basket
Empty
 
Copyright © 1999-2021 Silverfrost Limited