VEX IQ Python API
Public Member Functions | List of all members
timer.Timer Class Reference

Public Member Functions

def __init__ (self)
 Create the Timer class, does not start the timer. More...
 
def reset (self)
 Reset the time, clearing all data. More...
 
def start (self)
 Start or resume timing the current lap. More...
 
def stop (self)
 Stop or pause timing the current lap. More...
 
def start_lap (self)
 Stops the current lap and starts a new one. More...
 
def is_running (self)
 True if timer is currently running. More...
 
def elapsed_time (self, lap_index=-1)
 Elapsed time for the current lap (no args) or the lap with the given index. More...
 
def lap_count (self)
 Number of laps stored (including the current one). More...
 
def total_time (self)
 Total elapsed time for all laps. More...
 
def average_time (self)
 Average time per lap. More...
 

Constructor & Destructor Documentation

◆ __init__()

def timer.Timer.__init__ (   self)

Create the Timer class, does not start the timer.

Member Function Documentation

◆ reset()

def timer.Timer.reset (   self)

Reset the time, clearing all data.

◆ start()

def timer.Timer.start (   self)

Start or resume timing the current lap.

◆ stop()

def timer.Timer.stop (   self)

Stop or pause timing the current lap.

◆ start_lap()

def timer.Timer.start_lap (   self)

Stops the current lap and starts a new one.

◆ is_running()

def timer.Timer.is_running (   self)

True if timer is currently running.

◆ elapsed_time()

def timer.Timer.elapsed_time (   self,
  lap_index = -1 
)

Elapsed time for the current lap (no args) or the lap with the given index.

Negative indices (from the end) supported. Time in seconds.

◆ lap_count()

def timer.Timer.lap_count (   self)

Number of laps stored (including the current one).

◆ total_time()

def timer.Timer.total_time (   self)

Total elapsed time for all laps.

Time in seconds.

◆ average_time()

def timer.Timer.average_time (   self)

Average time per lap.

Time in seconds.