VEXcode Doxygen
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...

#include <vex_timer.h>

Public Member Functions

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...
 
double value () const
 Gets the current value of the timer in seconds. More...
 
void clear ()
 Sets the current value of the timer to 0. More...
 
void reset ()
 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...
 
static void event (void(*callback)(void *), uint32_t value)
 Sets a callback that will be called in the future. More...
 
static void event (void(*callback)(void), uint32_t value)
 Sets a callback that will be called in the future. More...
 

Detailed Description

Use the timer class to create timers for your program.

@prog_lang{pro}

Member Function Documentation

◆ clear()

void vex::timer::clear ( )

Sets the current value of the timer to 0.

@prog_lang{pro} @drawer_cat{action|none}

◆ event() [1/2]

static void vex::timer::event ( void(*)(void *)  callback,
uint32_t  value 
)
static

Sets a callback that will be called in the future.

@prog_lang{pro} @drawer_cat{setting|none}

Parameters
callbackA pointer to a function that will be called when the timer expires.
valueThe delay in mS to when the function will be called.

◆ event() [2/2]

static void vex::timer::event ( void(*)(void)  callback,
uint32_t  value 
)
static

Sets a callback that will be called in the future.

@prog_lang{pro} @drawer_cat{setting|none}

Parameters
callbackA pointer to a function that will be called when the timer expires.
valueThe delay in mS to when the function will be called.

◆ reset()

void vex::timer::reset ( )

Sets the current value of the timer to 0.

@prog_lang{pro} @drawer_cat{action|none}

◆ system()

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

Gets the current value of the system timer in mS.

@prog_lang{pro} @drawer_cat{sensing|none}

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).

@prog_lang{pro} @drawer_cat{sensing|none}

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

◆ time() [1/2]

uint32_t vex::timer::time ( ) const

Gets the current value of the timer in mS.

@prog_lang{pro} @drawer_cat{sensing|none}

Returns
Returns 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.

@prog_lang{pro} @drawer_cat{sensing|none}

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

◆ value()

double vex::timer::value ( ) const

Gets the current value of the timer in seconds.

@prog_lang{pro} @drawer_cat{sensing|none}

Returns
Returns the current value of the timer in seconds.

The documentation for this class was generated from the following file: