APG
… ABNF Parser Generator
|
A timer component API. More...
#include "ApgUtilities.h"
Go to the source code of this file.
Functions | |
void * | vpTimerCtor (void *vpMemCtx) |
void | vTimerDtor (void *vpCtx) |
apg_uint | uiTimerStart (void *vpCtx) |
apg_uint | uiTimerStop (void *vpCtx) |
apg_uint | uiTimerRates (void *vpCtx, double *dpRates, apg_uint uiLen, double dConversion) |
double | dTimerStartTime (void *vpCtx, double dConversion) |
double | dTimerStopTime (void *vpCtx, double dConversion) |
double | dTimerDuration (void *vpCtx, double dConversion) |
A timer component API.
A convenient timer API used for the timing studies in the APG examples. Uses a "context handle" or pointer to an opaque data structure for data encapsulation.
Definition in file timer.c.
double dTimerDuration | ( | void * | vpCtx, |
double | dConversion | ||
) |
The timed duration in specified units.
vpCtx | context handle previously returned from vpTimerCtor() |
dConversion | a time units conversion factor. Use 1 for seconds, 1000 for milliseconds, etc. |
The following #define macros are available:
APG_TIMER_SEC - return value in seconds APG_TIMER_MILLISEC - return value in milliseconds APG_TIMER_MICROSEC - return value in microseconds
double dTimerStartTime | ( | void * | vpCtx, |
double | dConversion | ||
) |
Get the start time in specified units.
vpCtx | context handle previously returned from vpTimerCtor() |
dConversion | a time units conversion factor. Use 1 for seconds, 1000 for milliseconds, etc. |
The following #define macros are available:
APG_TIMER_SEC - return value in seconds APG_TIMER_MILLISEC - return value in milliseconds APG_TIMER_MICROSEC - return value in microseconds
double dTimerStopTime | ( | void * | vpCtx, |
double | dConversion | ||
) |
Get the stop time in specified units.
vpCtx | context handle previously returned from vpTimerCtor() |
dConversion | a time units conversion factor. Use 1 for seconds, 1000 for milliseconds, etc. |
The following #define macros are available:
APG_TIMER_SEC - return value in seconds APG_TIMER_MILLISEC - return value in milliseconds APG_TIMER_MICROSEC - return value in microseconds
Convert any value into a rate (value/duration).
eg. If the parser parsed uiCharacters characters between the start and stop times, uiTimerRates(vpCtx, &uiCharacters, 1, APG_TIMER_MILLISEC) would overrite uiCharacters with uiCharacters/duration in the specified units.
vpCtx | context handle previously returned from vpTimerCtor() |
dpRates | an array of values to convert to rates |
uiLen | the number of values in the array. |
dConversion | a time units conversion factor. Use 1 for seconds, 1000 for milliseconds, etc. |
The following #define macros are available:
APG_TIMER_SEC - return value in seconds APG_TIMER_MILLISEC - return value in milliseconds APG_TIMER_MICROSEC - return value in microseconds
apg_uint uiTimerStart | ( | void * | vpCtx | ) |
Start the timer.
vpCtx | context handle previously returned from vpTimerCtor() |
apg_uint uiTimerStop | ( | void * | vpCtx | ) |
Stop the timer.
vpCtx | context handle previously returned from vpTimerCtor() |
void* vpTimerCtor | ( | void * | vpMemCtx | ) |
Constructs a timer component.
vpMemCtx | pointer to a Memory component |
void vTimerDtor | ( | void * | vpCtx | ) |
Destroys a timer component.
vpCtx | context handle previously returned from vpTimerCtor() |