Community
cancel
Showing results for 
Search instead for 
Did you mean: 
CBrou1
New Contributor I
936 Views

Strange value generated by clock() and CLOCKS_PER_SEC

When I get a program to print out the value of CLOCKS_PER_SEC I get1000000 but when I make an approximate measurement with the function clock() in a loop I get to a value closer to 250 !

( i am working with the Eclipse IDE)

Any idea why ?

3 Replies
MGilm
New Contributor I
78 Views

It would be good to provide more details...

I'm assuming you have some kind of software loop that you wrote - can we see it? Any other applicable code we can look at?

Where are you measuring the clock?

How are you measuring the clock - are you using a scope or something else?

Mike

CBrou1
New Contributor I
78 Views

Thanks for your response but please ignore my post. Something was wrong with my initial test ... and the results were spurious

clock() does tick in microseconds. - sorry

MGilm
New Contributor I
78 Views

CABrouwers

That's good to hear. Cheers.

Reply