Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9867 Discussions

Strange value generated by clock() and CLOCKS_PER_SEC

CBrou1
New Contributor I
982 Views

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
124 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
124 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
124 Views

CABrouwers

That's good to hear. Cheers.

Reply