timing Struct Reference
[Timing API]

Timing module functions. More...

#include <timing.h>

List of all members.

Public Attributes

Timer *(* start )(uint64_t start, uint16_t interval, void(*function)(void *), void *arg)
 Start a timer which executes the given function at the given interval.
void(* update )(Timer *timer, uint16_t interval)
 Update a timer interval.
void(* cancel )(Timer *timer)
 Cancel (stop) a timer.
int64_t(* now )(void)
 Return the current time in milliseconds since the epoch.


Detailed Description

Timing module functions.

Definition at line 22 of file timing.h.


Member Data Documentation

void(* timing::cancel)(Timer *timer)

Cancel (stop) a timer.

Will cause function invocation to immediately cease, and may result in the immediate deallocation of any resources associated with the given timer handle. Thus, a timer handle is unsafe to use after cancelling.

Parameters:
timer Opaque timer handle.

int64_t(* timing::now)(void)

Return the current time in milliseconds since the epoch.

Returns:
Number of milliseconds since the epoch.

Timer*(* timing::start)(uint64_t start, uint16_t interval, void(*function)(void *), void *arg)

Start a timer which executes the given function at the given interval.

Timers execute a given function periodically at a given interval, with an optional start delay for the first invocation. Will continue indefinitely until cancelled. The interval (period) can be modified at any time during timer execution.

Parameters:
start Absolute start time in milliseconds since the epoch. If greater than "now", timer start will be delayed until this time.
interval Interval in milliseconds between periodic invocations of the given function.
function Function to execute whenever the timer interval is reached.
arg Opaque pointer which will be given to the function as an argument whenever it is executed.
Returns:
Opaque timer pointer.

void(* timing::update)(Timer *timer, uint16_t interval)

Update a timer interval.

While a timer is running, its interval can be changed at any time. Such a request will be realized either in the current or next period, depending on implementation and feasibility (i.e. the current period may be shortened or lengthened, or it may proceed for the length of the old interval. The next period is guaranteed to last the newly specified interval in all cases).

Parameters:
timer Opaque timer handle.
interval Requested new interval in milliseconds.


The documentation for this struct was generated from the following file:
Generated on Thu Sep 27 11:11:48 2012 for VetSim by  doxygen 1.4.7