Mojo struct
Batch
struct Batch
A batch of benchmarks, the benchmark.run() function works out how many iterations to run in each batch based the how long the previous iterations took.
Fields
- duration (
Int): Total duration of batch stored as nanoseconds. - iterations (
Int): Total iterations in the batch.
Implemented traits
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
RegisterPassable,
TrivialRegisterPassable,
Writable
Methods
mean
mean(self, unit: String = Unit.s) -> Float64
Returns the average duration of the batch.
Args:
- unit (
String): The time unit to display for example: ns, ms, s (defaults).
Returns:
Float64: The average duration of the batch.
write_to
write_to(self, mut writer: T)
Formats this Batch to the provided Writer.
Args:
- writer (
T): The object to write to.
write_repr_to
write_repr_to(self, mut writer: T)
Writes the repr of this Batch to a writer.
Args:
- writer (
T): The object to write to.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!