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.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, ImplicitlyCopyable, ImplicitlyDestructible, Movable

comptime members

Benchmark

comptime Benchmark = Mode(0)

Mode for running actual benchmarks.

Test

comptime Test = Mode(1)

Mode for running tests.

Methods

__eq__

__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.