I am doing tower of hanoi, and need calculate the time for the function. However,i try many type such as time.h or windows.h...Since the function is recursive and very fast to end. hence,the result always be 0 since time start -time end equal 0.So, I am here to ask all of the experts how i can get more precise time value...thanks alot..

Timing is often done in loops.

Do your function a hundred-thousand times and calculate how long it took to do that.

Hope this helps.

Do your function a hundred-thousand times and calculate how long it took to do that.

Hope this helps.

Topic archived. No new replies allowed.