#include // include I/O library #include // include the library "ctime" // we can use "ctime" in C++ instead of using "time.h" in C using namespace std; // specify to use the "std" namespace // main test function int main() { // define "start" "finish" as "clock_t" type clock_t start; clock_t finish; // get the delay of executing the clock() function start = clock(); finish = clock(); double delay = (double)(finish - start); // start timing. Keep the start time in "start" start = clock(); // *** BEGIN YOUR PROGRAM HERE *** for (int i=0; i<122000000; i++) {} // *** END YOUR PROGRAM *** // finish timing. Keep the end time in "finish" finish = clock(); // compute the exact running time without the delay double elapsed_iter = (double)(finish - start); elapsed_iter -= delay; // covert to second format double elapsed_second = elapsed_iter / CLOCKS_PER_SEC; // output the time elapsed. cout<<"Time elapsed:"<<(double)elapsed_second<<" seconds."<