SourcePoint AMD Help

Table of Contents

clock

Return the elapsed time (in ms) since SourcePoint started.

Syntax

[result =] clock()

Where:

result

specifies an ord4 variable to which the function return value is assigned. If result is not specified, the return value is displayed on the next line of the screen.

Discussion

The clock function returns the elapsed time (in ms) since SourcePoint was started. ย The return value can be assigned to an ord4 variable, or displayed on the command line.

Example 1

Command Input:

clock()

Result:

0000F124H

Example 2

To measure the elapsed time of an operation:

Command Input:

define ord4 startTime = clock()

(some operations...)

printf ("elapsed time = %.3f seconds\n", (clock() - startTime) / 1000.0)

Result:

elapsed time = 3.2 seconds

Related Topics: