Functions | |
int | InitCounter (char *name) |
void | StartCounter (int CounterId) |
void | StopCounter (int CounterId) |
unsigned int | GetTempo (float freq) |
int | GetTstamp (void) |
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
freq | Desired sampling frequency, in Hz |
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.
int InitCounter | ( | char * | name | ) |
Initialize Counter Initializes a time counter. It uses stats services. It counts time in microseconds, until 1000000 (1s)
name | Name for the counter (stat) |
void StartCounter | ( | int | CounterId | ) |
Start time counter
CounterId | Id returned from InitCounter() function |
void StopCounter | ( | int | CounterId | ) |
Stop time Counter Stops the timer and saves statistics value with the resulting inteval
CounterId | Id returned from InitCounter() function |