Module benchmark

A module for benchmarking arbitrary Lua code.

Functions

benchmark (f, ...) Benchmark a function with given arguments.
benchmark_n (num, f, ...) Benchmark a function, running it a given number of times.


Functions

benchmark (f, ...)
Benchmark a function with given arguments.

Parameters:

  • f The function to call
  • ... Any arguments to pass to the function f

Returns:

    The time the function took, in seconds
benchmark_n (num, f, ...)
Benchmark a function, running it a given number of times.

Parameters:

  • num The number of times to run the function
  • f The function to call
  • ... Any arguments to pass to the function f

Returns:

  1. The average time taken
  2. The total time taken
generated by LDoc 1.3.12