TinyMUX

Benchmark()

Functions

Description

FUNCTION: benchmark(<expression>, <iterations>)

Evaluates the given expression the specified number of times and returns the total wall-clock time in seconds. The maximum number of iterations is 10000.

This function is useful for profiling and comparing the performance of different softcode approaches.

Examples

> say benchmark(add(1,2), 1000)

You say, “0.002145”

> say benchmark(iter(lnum(100),##), 500)

You say, “0.154320”

eval()