openavmkit.utilities.timing
TimingData
TimingData()
A simple timing class for quick & dirty performance profiling.
This class holds multiple internal "stopwatches" which can each keep track of their own running time.
Just instantiate a TimingData and call start()
and stop()
with a desired key.
Attributes:
Name | Type | Description |
---|---|---|
results |
dict[str:float]
|
Raw timing results |
Source code in openavmkit/utilities/timing.py
18 19 20 |
|
get
get(key)
Get the running time of the indicated stopwatch
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The stopwatch to get timing data for |
required |
Returns:
Type | Description |
---|---|
float
|
How long the indicated stopwatch has run, if it exists |
Source code in openavmkit/utilities/timing.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
print()
Print the value of all stopwatches
Source code in openavmkit/utilities/timing.py
70 71 72 73 74 75 76 77 |
|
start
start(key)
Start a named stopwatch
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
Name of the stopwatch to begin timing, or resume timing if it already exists. |
required |
Source code in openavmkit/utilities/timing.py
22 23 24 25 26 27 28 29 30 31 32 33 |
|
stop
stop(key)
Stop a named stopwatch
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
If this stopwatch has been started before, stops it if running and calculates how long it has run for. |
required |
Returns:
Type | Description |
---|---|
float
|
How long the stopwatch has been running for |
Source code in openavmkit/utilities/timing.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|