//-------------------------------------------------------------------- // // Laboratory C testc.cs // // Test program for the operations in the Timer ADT // //-------------------------------------------------------------------- #include #include #include #include "timer.h" using namespace std; // wait() is cross platform and works well but is not efficient. // Feel free to replace it with a routine that works better in // your environment. void wait(int secs) { int start = clock(); while (clock() - start < CLOCKS_PER_SEC * secs); } void main() { Timer checkTimer; // Timer clock_t timeInterval; // Time interval to pause // Get the time interval. // Measure the specified time interval. checkTimer.start(); // Start the timer // Pause for the specified time interval checkTimer.stop(); // Stop the timer cout << "Measured time interval ( in seconds ) : " << checkTimer.getElapsedTime() << endl; }