Program to find time used by Loop
#include <time.h>
#include <stdio.h>
main()
{
time_t start, end;
volatile long unsigned t;
start = time(NULL);
for(t=0; t<500; t++) ;
end = time(NULL);
printf("Loop used %f seconds.\n", difftime(end, start));
getch();
//return 0;
}
Comments
Post a Comment