11.3.4. Reading the simulated time

When it performs a simulation, the ARMulator keeps track of the total time elapsed. This value may be read either by the simulated program or by the debugger.

Reading the simulated time from assembler

To read the simulated clock from an assembly language program use the Angel SYS_CLOCK SWI.

Reading the simulated time from C

From C, use the standard C library function clock(). This function returns the number of elapsed centiseconds.

Reading the simulated time from the debugger

The internal variable $clock contains the number of microseconds since simulation started. To display this value, use the command:

Print $clock

if you are using armsd, or select Debugger Internals from the View menu if you are using ADW or ADU.


The $clock internal variable is unavailable if the processor clock frequency is set to 0.00. You must specify a processor clock frequency for ARMulator if you wish to read the $clock variable. Select Options  ? Configure Debugger...  ? Target  ? ARMulate  ? Configure... and use the ARMulator Configuration dialog.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D