// Purpose: provide a stopwatch that can be started and stopped as // a process executes. // Author: Doug Moore. // Date: Feb. 17, 2000 #include class stopWatch { public: void set_start() {start=times(&starttest);} void set_stop() { end=times(&endtest); elapsed=(float)(endtest.tms_utime - starttest.tms_utime)/100; } int get_start() {return start;} int get_stop() {return end;} float get_elapsed() {return elapsed;} private: clock_t start; clock_t end; tms starttest; tms endtest; float elapsed; };