#include #include #include static clock_t begin; static clock_t then; static clock_t now; void start_timing() { now = clock(); begin = clock(); } void timing(char *message) { double secs; then = now; now = clock(); secs = double(now-then)/CLOCKS_PER_SEC; printf("%s: %6.2f\n", message, secs); } void end_timing() { double secs; now = clock(); secs = double(now-begin)/CLOCKS_PER_SEC; printf("%s: %6.2f\n\n", "Total time", secs); }