mlrl.testbed.experiments.timer module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides utilities for measuring time.

class mlrl.testbed.experiments.timer.Timer

Bases: object

Allows measuring the execution time of code.

class Duration(value: float = 0.0)

Bases: object

Represents a specific duration.

Attributes:

value: The value (in fractional seconds) representing the duration

value: float = 0.0
class Time(time: float)

Bases: object

Represents a specific point in time.

Attributes:

time: The time in “float seconds”

time: float
static start() Time

Measures and returns the current time.

Returns:

The current time

static stop(start_time: Time) Duration

Measures and returns the execution time that has passed since a given Time.

Parameters:

start_time – A specific time in the past

Returns:

A Duration representing the time that has passed