/* Timer class code plus a little demo program */ #include #include #include "timer.h" using namespace std; /* Time class code */ // constructor cTimer::cTimer(void) { setTime = clock(); } // start the timer void cTimer::startTimer() { setTime = clock(); } // wait numSeconds after timer set void cTimer::endTimer(float numSeconds) { clock_t nowTime; nowTime=clock(); while (numSeconds > (float) (nowTime-setTime)/ (float) CLK_TCK) { nowTime=clock(); } return; }