//-------------------------------------------------------------------- // // Laboratory 15 test15.cpp // // Test program for the operations in the Timer ADT // //-------------------------------------------------------------------- #include #include // for sleep(int) function #include "timer.h" // for Timer objects void main() { Timer checkTimer; // Timer int dimension; // Size of an integer array dimension // Get the time interval. cout << endl; cout << "Enter an integer as bounds for a tw-dimensional array : "; cin >> dimension; // Count clock ticks to display the array indices. checkTimer.start(); // Start the timer for (int i = 0; i < dimension; i++) for (int j = 0; j < dimension; j++) cout << i << ':' << j << endl; checkTimer.stop(); // Stop the timer cout << "Measured time interval (clock ticks) : " << checkTimer.elapsedTime() << endl; }