| C++ Timer |
|
|
|
| Written by Steve Leonard |
| Monday, 23 February 2009 12:25 |
|
#include <time.h> #include <stdio.h> /*______________________________________________________________________________ void reset() // Start the clock // Stop the clock and return cumulative elapsed time (in seconds). // Return time accumulated so far. private: }; // timer // Test the timer timer1.start(); for (long i = 0; i < 10000000; i++); timer1.stop(); printf("Total seconds <%f>\n", timer1.elapsed()); |