For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
Mode
struct Mode
Defines a Benchmark Mode to distinguish between test runs and actual benchmarks.
Fields
- value (
Int): Represents the mode type.
Implemented traits
AnyType,
Copyable,
Deinitable,
ImplicitlyCopyable,
Movable
comptime members
benchmark
comptime benchmark = Mode(Int(0))
Mode for running actual benchmarks.
Benchmark
comptime Benchmark = Mode.benchmark
Deprecated: The former name of benchmark.
Deprecated: 'Benchmark' is deprecated, use 'benchmark' instead
test
comptime test = Mode(Int(1))
Mode for running tests.
Test
comptime Test = Mode.test
Deprecated: The former name of test.
Deprecated: 'Test' is deprecated, use 'test' instead
Methods
__eq__
def __eq__(self, other: Self) -> Bool
Check if its Benchmark mode or test mode.
Args:
- other (
Self): The mode to be compared against.
Returns:
Bool: If its a test mode or benchmark mode.