Calculating the execution time in C

#include<stdio.h>
#include<time.h>
     void myfun()
{
printf("hi.....");
}             
int main()
{
    clock_t t2,t1=clock();
 myfun();
t2=clock();
printf("the time difference in seconds is:%d",(t2-t1)/CLOCKS_PER_SEC);
return 0;
}        


Comments

Popular posts from this blog

What is the formula of success?

In praise of MSD, the best finisher in cricket history

Amazon launches palm scanners for 'secure' payments: can we trust this system?