Go to the source code of this file.
Functions | |
int | start_chrono () |
Start the stopwatch. | |
int | stop_chrono () |
Stop the stopwatch. | |
unsigned long int | get_ms () |
Get the measured time in ms. | |
int | set_one_shot_timer (long sec, long micro_second) |
Create a one shot timer which precision is the micro second. The timer raises the signal SIGALRM when the timout expired. | |
int | cancel_one_shot_timer () |
Cancel the previously activated one shot timer. | |
int | pause_one_shot_timer () |
Pause the one shot timer. | |
int | restart_one_shot_timer () |
Restart the one shot timer. | |
Variables | |
timeval | start |
Static variable used by start_chrono() to save the starting timestamp. | |
timeval | stop |
Static variable used by stop_chrono() to save the stoping timestamp. | |
itimerval | one_shot_timer |
This structure is used to specify the timer's delay (for a one shot timer). | |
itimerval | old_one_shot_timer |
This variable is used by the system call setitimer(). This system call requires a structure itimerval to save the current timer configuration (it is not used here). | |
itimerval | current_one_shot_timer |
This variable is used by the functions pause_one_shot_timer() and restart_one_shot_timer(). It is used to save the current timer's state (i.e: the remaining time). |
Definition in file timing.c.
|
Cancel the previously activated one shot timer.
Definition at line 99 of file timing.c. References CANCEL_ONE_SHOT_TIMER_ERROR, CANCEL_ONE_SHOT_TIMER_OK, old_one_shot_timer, and one_shot_timer. Referenced by pause_one_shot_timer(). |
|
Get the measured time in ms.
|
|
Pause the one shot timer.
Definition at line 124 of file timing.c. References cancel_one_shot_timer(), CANCEL_ONE_SHOT_TIMER_OK, current_one_shot_timer, PAUSE_ONE_SHOT_TIMER_ERROR, and PAUSE_ONE_SHOT_TIMER_OK. |
|
Restart the one shot timer.
Definition at line 148 of file timing.c. References current_one_shot_timer, old_one_shot_timer, RESTART_ONE_SHOT_TIMER_ERROR, and RESTART_ONE_SHOT_TIMER_OK. |
|
Create a one shot timer which precision is the micro second. The timer raises the signal SIGALRM when the timout expired.
Definition at line 75 of file timing.c. References old_one_shot_timer, one_shot_timer, SET_ONE_SHOT_TIMER_ERROR, and SET_ONE_SHOT_TIMER_OK. |
|
Start the stopwatch.
Definition at line 18 of file timing.c. References start. |
|
Stop the stopwatch.
Definition at line 27 of file timing.c. References stop. |