IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.1.0
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.

Test​

comptime Test = Mode(Int(1))

Mode for running tests.

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.