benchmark

This function runs the passed callable T for the duration of maxRuntime. It will count how often T is run in the duration and how long each run took to complete.

Unless compiled in release mode, statistics will be printed to stderr. If compiled in release mode the statistics are appended to a file called name.

  1. void benchmark(BenchmarkOptions opts)
  2. void benchmark(string funcname, string filename)
  3. void benchmark(from!"std.datetime".Duration maxRuntime, string filename)
  4. void benchmark(string name, from!"std.datetime".Duration maxRuntime, string filename)
    void
    benchmark
    ()
    (
    string name
    ,
    from!"std.datetime".Duration maxRuntime
    ,
    string filename = __FILE__
    )

Parameters

name string

The name of the benchmark. The name is also used as filename to save the benchmark results.

maxRuntime from!"std.datetime".Duration

The maximum time the benchmark is executed. The last run will not be interrupted.

Meta