Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: high accuracy timing options?



Aaron Turner writes:
 > Interesting how gettimeofday() fails to increment around 90% of the
 > time.   I guess technically incrementing 1/10 times while requiring

FWIW, I hacked your program to keep some stats, and on a core2 iMac
I have access to, I see an average increment of just over 1us
with an occasional outlier of a few ms (probably when something
stole the CPU from the app).  Given that gtod has a 1us granualarity,
and the program is not realtime, that is not too bad.

 > ~13 times to measure a usec is good enough, but it's not giving me a
 > warm & fuzzy feeling.  Running a tight gettimeofday() loop in my
 > application seems to have good results down to 8usec between events

I have no idea what you're trying to do, so its hard to provide
any solution that would make you warm and fuzzy.  I was mearly
suggesting that the accuracy of gettimeofday() on MacOSX is likely
good enough for most timing you might want to do..

Drew

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >high accuracy timing options? (From: "Aaron Turner" <email@hidden>)
 >Re: high accuracy timing options? (From: Andrew Gallatin <email@hidden>)
 >Re: high accuracy timing options? (From: "Aaron Turner" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.