Method gauge()


Method gauge

float gauge(mixed expression)

Description

Gauge the time that the expression takes to evaluate.

Parameter expression

Expression to evaluate.

Analogous to catch(), there are two syntaxes:

float elapsed = gauge(expression);

and

float elapsed = gauge {
      // Code block
    };

Where the latter is more versatile and more common.

Returns

Returns the time in seconds as a float.

Note

gauge is not a function, but a special form. It is thus not valid to pass as a function.

See also

catch(), gethrvtime()