Timing
amltk.profiling.timing
#
Module for timing things.
Timer
dataclass
#
A timer for measuring the time between two events.
ATTRIBUTE | DESCRIPTION |
---|---|
start_time |
The time at which the timer was started.
TYPE:
|
kind |
The method of timing.
TYPE:
|
Interval
dataclass
#
Kind
#
An enum for the type of timer.
from_str
classmethod
#
Get the enum value from a string.
PARAMETER | DESCRIPTION |
---|---|
key |
The string to convert.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Kind | NAType
|
The enum value. |
Source code in src/amltk/profiling/timing.py
Unit
#
An enum for the units of time.
from_str
classmethod
#
Get the enum value from a string.
PARAMETER | DESCRIPTION |
---|---|
key |
The string to convert.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Unit | NAType
|
The enum value. |
Source code in src/amltk/profiling/timing.py
from_dict
classmethod
#
Create a time interval from a dictionary.
Source code in src/amltk/profiling/timing.py
start
classmethod
#
Start a timer.
PARAMETER | DESCRIPTION |
---|---|
kind |
The type of timer to use.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Timer
|
The timer. |
Source code in src/amltk/profiling/timing.py
stop
#
stop() -> Interval
Stop the timer.
RETURNS | DESCRIPTION |
---|---|
Interval
|
A tuple of the start time, end time, and duration. |
Source code in src/amltk/profiling/timing.py
time
classmethod
#
Time a block of code.
PARAMETER | DESCRIPTION |
---|---|
kind |
The type of timer to use.
TYPE:
|
YIELDS | DESCRIPTION |
---|---|
Interval
|
The Time Interval. The start and end times will not be |
Interval
|
valid until the context manager is exited. |