/* calculate the execution time of program */ #include<stdio.h> #include<time.h> int main() { int i; double total_time; clock_t start, end; start = clock(); // start time srand(time(NULL)); for (i = 0; i < 2500; i++) { printf("%d",i); } end = clock(); // end time total_time = ((double) (end - start)) / CLK_TCK; // calculate the time printf("\nTime using: %f", total_time); return 0; }