timer

Returns the elapsed time.

Syntax

timer([expr])

Argument

[expr]
An optional expression used to set the timer.

Example

Templex Expression
{
    t = timer(0);
    for (i = 0; i < 1000; i++)
        ‘ do something
    endloop
    "The loop took "; timer(); " microseconds."; cr();
}

Comments

If timer is used without an argument, it returns the elapsed time in microseconds since the first time it was called.

If timer is used with an argument, the clock is reset to the value (in microseconds) specified by expr.