VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
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.
 
double time (timeUnits units) const
 Gets the current value of the timer in specified units.
 
double value () const
 Gets the current value of the timer in seconds.
 
void clear ()
 Sets the current value of the timer to 0.
 
void reset ()
 Sets the current value of the timer to 0.
 

Static Public Member Functions

static uint32_t system ()
 Gets the current value of the system timer in mS.
 
static void event (void(*callback)(void *), uint32_t value)
 Sets a callback that will be called in the future.
 
static void event (void(*callback)(void), uint32_t value)
 Sets a callback that will be called in the future.
 

Detailed Description

Use the timer class to create timers for your program.

@prog_lang{pro}

Definition at line 27 of file vex_timer.h.

Member Function Documentation

◆ event() [1/2]

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

Sets a callback that will be called in the future.

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(* callback )(void),
uint32_t value )
static

Sets a callback that will be called in the future.

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.

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

◆ time() [1/2]

uint32_t vex::timer::time ( ) const

Gets the current value of the timer in mS.

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.

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.

Returns
Returns the current value of the timer in seconds.

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