torchkit.utils.timer

class torchkit.utils.timer.Stopwatch[source]

A simple timer for measuring elapsed time.

Example usage:

stopwatch = Stopwatch()
some_func()
print(f"some_func took: {stopwatch.elapsed()} seconds.")
stopwatch.reset()
Return type

None

__init__()[source]
Return type

None

elapsed()[source]

Return the elapsed time since the stopwatch was reset.

Return type

float

reset()[source]

Reset the stopwatch, i.e. start the timer.

Return type

None