(in ./Carbon/Bench.lua)

Helps to benchmark things!


object public Bench:Add(string name, function method)

Returns self

  • required name: The name of the benchmark to add.
  • required method: A single iteration of the benchmark.

Adds a benchmark to be tested with this benchmark.

object public Bench:Describe(string desc)

Returns self

  • required desc: The description of the bench.

Adds a description to this Bench to be used when showing results.

object public Bench:Results()

Returns string

Returns the results of the benchmark; only valid after calling Bench:Run().

object public Bench:Run(unumber iterations)

Returns self

  • required iterations: The number of iterations to run the bench for.

Runs all registered benchmarks on this Bench.