Skip to content

Latest commit

 

History

History
180 lines (87 loc) · 4.52 KB

File metadata and controls

180 lines (87 loc) · 4.52 KB

module utilities.timer

Global Variables

  • timer_t0
  • timer_t1

class timeit

A timer utility class that provides methods to measure elapsed time in minutes, seconds, and milliseconds. The class also has methods to reset the timer and sum the total elapsed time.

Attributes:

  • start (float): The timestamp when the timer was started.
  • sum_timer (float): The total elapsed time since the timer was created or reset.

method __init__

__init__()

Initializes a new instance of the timeit class and starts the timer.


method milliseconds

milliseconds(reset=False)

Calculates the elapsed time in milliseconds since the timer was started or reset.

Args:

  • reset (bool): If True, resets the timer to the current timestamp.

Returns:

  • float: The elapsed time in milliseconds, rounded to three decimal places.

method minutes

minutes(reset=False)

Calculates the elapsed time in minutes since the timer was started or reset.

Args:

  • reset (bool): If True, resets the timer to the current timestamp.

Returns:

  • float: The elapsed time in minutes, rounded to one decimal place.

method reset

reset()

Resets the timer to the current timestamp.


method reset_all

reset_all()

Resets the timer to the current timestamp and resets the total elapsed time.


method seconds

seconds(reset=False)

Calculates the elapsed time in seconds since the timer was started or reset.

Args:

  • reset (bool): If True, resets the timer to the current timestamp.

Returns:

  • float: The elapsed time in seconds, rounded to three decimal places.

method sum_minutes

sum_minutes()

Returns the total elapsed time in minutes.

Returns:

  • float: The total elapsed time in minutes, rounded to one decimal place.

method sum_timer_minutes

sum_timer_minutes(reset=True)

Calculates the elapsed time in minutes since the timer was started or reset and adds it to the total elapsed time.

Args:

  • reset (bool): If True, resets the timer to the current timestamp.

This file was automatically generated via lazydocs.