"It doesn't work" is hardly a useful problem report. Why don't you post the code that "doesn't work" and tell us what you expected it to do. Then we'll tell you what you did wrong.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
For trivial programs, using clock() is like using a sun-dial to measure the speed of a Ferrari - "Why is it always 0, because it's too damn fast that's why!".
Even the most optimistic precision (not accuracy) figures for clock() are at least 1M times slower than the clock frequency of most modern desktop machines.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Even the most optimistic precision (not accuracy) figures for clock() are at least 1M times slower than the clock frequency of most modern desktop machines.
Not that it stops you from using clock(). All you gotta do is just put the code in a loop and run it a few 100/1000 times. You'll have your figures.
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75