ctime !

hey guys,

I wrote a simple O(n) sorting program. I need to check its time elapsed using ctime but the whole library confuses me...

the whole program is looped 1000 times so that the number will be greater then 1 second.

any help would be awesome!


thanks,
Shawn
1
2
3
4
5
clock_t t0,t1;
t0=clock();
//code to benchmark
t1=clock();
double time_in_seconds=double(t1-t0)/double(CLOCKS_PER_SEC);
thank you :)

Topic archived. No new replies allowed.