00001 00002 #include <time.h> 00003 00004 typedef struct{ 00005 int running; /* boolean */ 00006 double last_time; 00007 double total; 00008 00009 } *Stopwatch, Stopwatch_struct; 00010 00011 00012 00013 double seconds(); 00014 00015 void Stopwtach_reset(Stopwatch Q); 00016 00017 Stopwatch new_Stopwatch(void); 00018 void Stopwatch_delete(Stopwatch S); 00019 void Stopwatch_start(Stopwatch Q); 00020 void Stopwatch_resume(Stopwatch Q); 00021 void Stopwatch_stop(Stopwatch Q); 00022 double Stopwatch_read(Stopwatch Q); 00023