Next: , Previous: , Up: Other statements   [Contents][Index]

4.8.2 Delaying execution

It is sometimes interesting to measure the progress of a communication pattern when delays are inserted at various times on various tasks. coNCePTuaL provides two mechanisms for inserting delays: one that relinquishes the CPU while delaying ( SLEEP) and one that hoards it ( COMPUTE).

<delay_stmt> ::= <source_task>
FOR <expr> <time_unit>

<source_task> (see Source tasks) specifies the set of tasks that will stall. <expr> (see Arithmetic expressions) specifies the number of <time_unit>s for which to delay and <time_unit> represents any of the following measures of time:


Delay times are only approximate. SLEEP’s accuracy depends upon the operating-system’s clock resolution or length of time quantum (commonly measured in milliseconds or tens of milliseconds). COMPUTE, which is implemented by repeatedly reading a variable until the desired amount of time elapses, is calibrated during the coNCePTuaL run-time system’s initialization phase and can be adversely affected by intermittant system load. Both forms of <delay_stmt> attempt to measure wall-clock time (“real time”), not just the time the program is running (“virtual time”). Because the delay times are approximate, it is strongly recommended that the elapsed_usecs variable (see Predeclared variables) be employed to determine the actual elapsed time.

Next: , Previous: , Up: Other statements   [Contents][Index]

Scott Pakin,