Posts

Showing posts from September, 2011

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; }