/*---------------------------------------------------------------*/ /* Project Allen Number (1994 ) */ /* ------------------------------------ */ /* */ /* Author : Marie-Noelle Aimar */ /* Medical Computer Laboratory */ /* University of Bordeaux II */ /* */ /* */ /* File : time.h */ /* */ /*---------------------------------------------------------------*/ #ifndef __TIMER__ #define __TIMER__ /* -- comment : a timer must be view as a counter in which the running -- time is stored. A chronometer is associated to the counter, -- it can be started and stopped. The time beetween the start -- and stop commands is then added to the counter. */ struct struct_timer { unsigned int chrono; unsigned int accu; } ; typedef struct struct_timer* type_timer; /*-------------------*/ extern type_timer create_timer(); /* -- comment : create a new timer (the counter is set to 0) */ extern void reinitialize_timer(type_timer timer); /* -- comment : set the counter to 0 */ extern void start_timer(type_timer timer); /* -- comment : starts the chronometer */ extern void stop_timer(type_timer timer); /* -- comment : stops the chronometer and adds its value to the counter -- require : the start_timer command must have been called */ extern void display_value_timer(type_timer timer); /* -- comment : display the value of the counter -- example : 123s45 */ /*-------------------*/ #endif