pinkyvidya
Member level 2
Inorder to find execution time in C program, I have used the following piece of code
1.
#include <stdio.h>
2.
#include <time.h>
3.
4.
clock_t start = clock();
5.
/* Code you want timed here */
6.
printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
and it is working..I would like to know whether the time it is showing is in seconds or milliseconds
Kindly someone please help. I will bw very thankful
1.
#include <stdio.h>
2.
#include <time.h>
3.
4.
clock_t start = clock();
5.
/* Code you want timed here */
6.
printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
and it is working..I would like to know whether the time it is showing is in seconds or milliseconds
Kindly someone please help. I will bw very thankful