Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

timing.h File Reference

Go to the source code of this file.

Defines

#define SET_ONE_SHOT_TIMER_ERROR   -1
 Return value for the function set_one_shot_timer(). An error occured while setting the one shot timer.

#define SET_ONE_SHOT_TIMER_OK   -2
 Return value for the function set_one_shot_timer(). The one shot timer was successfully created.

#define CANCEL_ONE_SHOT_TIMER_ERROR   -3
 Return value for the function cancel_one_shot_timer(). An error occured while canceling the one shot timer.

#define CANCEL_ONE_SHOT_TIMER_OK   -4
 Return value for the function cancel_one_shot_timer(). The one shot timer was successfully canceled.

#define PAUSE_ONE_SHOT_TIMER_ERROR   -5
 Return value for the function pause_one_shot_timer(). An error occured with the high precision timer.

#define PAUSE_ONE_SHOT_TIMER_OK   -6
 Return value for the function pause_one_shot_timer(). The one shot timer was successfully paused.

#define RESTART_ONE_SHOT_TIMER_ERROR   -7
 Return value for the function restart_one_shot_timer(). An error occured with the high precision timer.

#define RESTART_ONE_SHOT_TIMER_OK   -8
 Return value for the function restart_one_shot_timer(). The one shot timer was successfully restarted.

#define TIMING_HD

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.


Detailed Description

Header file for timing.c

Definition in file timing.h.


Function Documentation

int cancel_one_shot_timer  
 

Cancel the previously activated one shot timer.

Returns:
The function returns one of the following values:
  • CANCEL_ONE_SHOT_TIMER_ERROR: An error occured while canceling the timer.
  • CANCEL_ONE_SHOT_TIMER_OK: The timer is successfuly canceled.

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().

unsigned long int get_ms  
 

Get the measured time in ms.

Returns:
The function returns the number of mili seceond.

Definition at line 36 of file timing.c.

References start, and stop.

int pause_one_shot_timer  
 

Pause the one shot timer.

Returns:
The function return one of the following values:
  • PAUSE_ONE_SHOT_TIMER_ERROR: An error occured with the high precision timer.
  • PAUSE_ONE_SHOT_TIMER_OK: The operation was successful.
Warning:
You can restart the timer with restart_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.

int restart_one_shot_timer  
 

Restart the one shot timer.

Returns:
The function return one of the following values:
  • RESTART_ONE_SHOT_TIMER_ERROR: An error occured with the high precision timer.
  • RESTART_ONE_SHOT_TIMER_OK: The operation was successful.
Warning:
The timer should have been paused with the function pause_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.

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.

Parameters:
sec Number of second
micro_second Number of micro seconds.
Returns:
The function returns one of the following values:
  • SET_ONE_SHOT_TIMER_ERROR: An error occured while creating the timer.
  • SET_ONE_SHOT_TIMER_OK: The timer is successfuly created.

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.

int start_chrono  
 

Start the stopwatch.

Returns:
Upon successful completion, the function returns 0. Otherwise the function returns -1;

Definition at line 18 of file timing.c.

References start.

int stop_chrono  
 

Stop the stopwatch.

Returns:
Upon successful completion, the function returns 0. Otherwise the function returns -1;

Definition at line 27 of file timing.c.

References stop.


Generated on Thu Apr 3 16:23:47 2003 for Common_C_libraries by doxygen1.3-rc1