Timing Functions


Functions

int InitCounter (char *name)
void StartCounter (int CounterId)
void StopCounter (int CounterId)
unsigned int GetTempo (float freq)
int GetTstamp (void)

Detailed Description

This section contains the functions used for time management

Function Documentation

unsigned int GetTempo ( float  freq  ) 

Get Tempo

Returns the amount of samples to generate given a sampling frequency. It internally does a trivial operation however, the utility of this function overcomes when the object implementation does not have any information on the underlying time slicing (in other words, the object execution frequency). Thus, calling this function before every execution cycle gives the amount of samples to be generated given a desired sampling frequency and the platform-hidden time slot duration

Parameters:
freq Desired sampling frequency, in Hz
Returns:
Number of samples to be generated (freq*ts)

int GetTstamp ( void   ) 

Get current time stamp

Returns the current object time stamp, this is, the amount of time it has executed in the RUN state since the begining.

Returns:
Time stamp

int InitCounter ( char *  name  ) 

Initialize Counter Initializes a time counter. It uses stats services. It counts time in microseconds, until 1000000 (1s)

Parameters:
name Name for the counter (stat)
Returns:
Id for the counter. <0 if error

void StartCounter ( int  CounterId  ) 

Start time counter

Parameters:
CounterId Id returned from InitCounter() function

void StopCounter ( int  CounterId  ) 

Stop time Counter Stops the timer and saves statistics value with the resulting inteval

Parameters:
CounterId Id returned from InitCounter() function


Generated on Thu Jul 29 19:37:21 2010 for ALOESoftwareAPI(SWAPI) by  doxygen 1.5.5