This module implements tictoc matlab like timers.
More...
|
file | timer.cpp |
| Main sorce code from the c_timer class.
|
|
file | timer.h |
| main header file for this module. Includes, global vars, funtion prototypes, etc.
|
|
This module implements tictoc matlab like timers.
#define MINIMUM_IPC_SLEEP 0.005 |
runned when created class
Definition at line 61 of file timer.cpp.
double c_timer::get_toc |
( |
int |
i | ) |
|
function to get time
- Returns
- actual time in double format in seconds with a precision of 0.01sec
Definition at line 44 of file timer.cpp.
char c_timer::run_ipc_sleep |
( |
double |
desired_freq, |
|
|
int |
i, |
|
|
char |
verbose |
|
) |
| |
to use this method is required to run set_ipc_sleep method previously
- Parameters
-
desired_freq | - frequency to execute a specified code |
i | - number of timer |
verbose | - |
- Returns
Definition at line 148 of file timer.cpp.
void c_timer::run_sleep |
( |
int |
i, |
|
|
double |
desired_freq |
|
) |
| |
method to use inside thread to avoid collisions between threads
- Parameters
-
i | - the same number of used when called tic |
desired_freq | - frequency in Hz |
Definition at line 115 of file timer.cpp.
void c_timer::set_ipc_sleep |
( |
int |
i | ) |
|
method with run_ipc_sleep that allows that to set a refresh rate of a specified code.
- Parameters
-
i | - number of the ipc_sleep, it can exist 10 at maximum |
Definition at line 98 of file timer.cpp.
void c_timer::tic |
( |
int |
i | ) |
|
method when used with toc enables you to know how many time have passed since
- Parameters
-
i | - integer values from 0 to 10; |
Definition at line 190 of file timer.cpp.
void c_timer::toc |
( |
int |
i | ) |
|
method when used with t1c enables you to know how many time have passed since
- Parameters
-
i | - integer values from 0 to 10; |
Definition at line 205 of file timer.cpp.
method ruuned when class is destroyed
Definition at line 89 of file timer.cpp.