Skip to main content

Mojo struct

BenchmarkInfo

Defines a Benchmark Info struct to record execution Statistics.

Fields

  • name (String): The name of the benchmark.
  • result (Report): The output report after executing a benchmark.
  • measures (List[ThroughputMeasure, 0]): Optional arg used to represent a list of ThroughputMeasure's.
  • verbose_timing (Bool): Whether to print verbose timing results.

Implemented traits

AnyType, CollectionElement, Copyable, Movable, Stringable

Methods

__init__

__init__(inout self: Self, name: String, result: Report, measures: List[ThroughputMeasure, 0] = List(), verbose_timing: Bool = 0)

Constructs a BenchmarkInfo object to return benchmark report and statistics.

Args:

  • name (String): The name of the benchmark.
  • result (Report): The output report after executing a benchmark.
  • measures (List[ThroughputMeasure, 0]): Optional arg used to represent a list of ThroughputMeasure's.
  • verbose_timing (Bool): Whether to print verbose timing results.

__init__(inout self: Self, *, other: Self)

Explicitly construct a deep copy of the provided value.

Args:

  • other (Self): The value to copy.

__str__

__str__(self: Self) -> String

Gets a string representation of this BenchmarkInfo value.

Returns:

A string representing benchmark statistics.