#include #include using namespace std; int main() { int x; int m = 10000000; int start = clock(); // code to be timed for (int i = 0; i < m; i++) x = i; int end = clock(); cout << m << " took " << static_cast(end-start)/CLOCKS_PER_SEC << " seconds to run." << endl; m *= 10; start = clock(); // code to be timed for (int i = 0; i < m; i++) x = i; end = clock(); cout << m << " took " << static_cast(end-start)/CLOCKS_PER_SEC << " seconds to run." << endl; m *= 10; start = clock(); // code to be timed for (int i = 0; i < m; i++) x = i; end = clock(); cout << m << " took " << static_cast(end-start)/CLOCKS_PER_SEC << " seconds to run." << endl; return 0; }