VEX V5 C++ API
Public Member Functions | Static Public Member Functions | List of all members
vex::timer Class Reference

Use the timer class to create timers for your program. More...

Public Member Functions

 timer ()
 
 ~timer ()
 
void operator= (uint32_t value)
 
 operator uint32_t () const
 
uint32_t time () const
 Gets the current value of the timer in mS. More...
 
double time (timeUnits units) const
 Gets the current value of the timer in specified units. More...
 
void clear ()
 Sets the current value of the timer to 0. More...
 

Static Public Member Functions

static uint32_t system ()
 Gets the current value of the system timer in mS. More...
 
static uint64_t systemHighResolution ()
 Gets the current value of the high-resolution timer (in microseconds). More...
 

Detailed Description

Use the timer class to create timers for your program.

Constructor & Destructor Documentation

◆ timer()

vex::timer::timer ( )

◆ ~timer()

vex::timer::~timer ( )

Member Function Documentation

◆ operator=()

void vex::timer::operator= ( uint32_t  value)

◆ operator uint32_t()

vex::timer::operator uint32_t ( ) const

◆ time() [1/2]

uint32_t vex::timer::time ( ) const

Gets the current value of the timer in mS.

◆ time() [2/2]

double vex::timer::time ( timeUnits  units) const

Gets the current value of the timer in specified units.

Returns
Returns a double that represents the time in the specified units.
Parameters
unitsThe measurement unit for time.

◆ clear()

void vex::timer::clear ( )

Sets the current value of the timer to 0.

◆ system()

static uint32_t vex::timer::system ( )
static

Gets the current value of the system timer in mS.

Returns
Returns the value of the system timer in mS.

◆ systemHighResolution()

static uint64_t vex::timer::systemHighResolution ( )
static

Gets the current value of the high-resolution timer (in microseconds).

Returns
Returns the current value of the high-resolution timer (in microseconds).