I am trying timestamp a simple insertion sort program that I am writing....but so far I have been unable to get meaningful results. The program does not take very long to run...but using the clock() function I thought that this would still output some values...but I still get zero.
The machine I am on has 1000000 CLOCKS_PER_SEC. Right before I start the sort I call the clock function and save to a clock_t variable. Then at the very end of the program i do the same thing to another clock_t variable. The only problem is that these two values are always the same..which means my program has a runtime of 0 clock ticks? This cant be right.
What am I doing wrong? Or is there another function that would work better for time-stamping (cant use time() cuz i need more precision than just seconds).
Any help would be greatly appreciated.
Thanks
robbaggio
The machine I am on has 1000000 CLOCKS_PER_SEC. Right before I start the sort I call the clock function and save to a clock_t variable. Then at the very end of the program i do the same thing to another clock_t variable. The only problem is that these two values are always the same..which means my program has a runtime of 0 clock ticks? This cant be right.
What am I doing wrong? Or is there another function that would work better for time-stamping (cant use time() cuz i need more precision than just seconds).
Any help would be greatly appreciated.
Thanks
robbaggio