Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cpsmusic

macrumors newbie
Original poster
Feb 24, 2008
23
0
I'm porting a Windows app that uses the Performance Counter for some timing measurements. It's important that the measurements are as accurate as possible.

Is there an accurate timer available on the Mac? If so, where can I find info about it?

Cheers,

Chris
 

cpsmusic

macrumors newbie
Original poster
Feb 24, 2008
23
0
Thanks for the info.

I don't think those timers will be accurate enough.

Also, I'm using C++ (sorry, forgot to mention that before).

Cheers,

Chris
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
as an aside, in the abscence of a real-time OS whose scheduler can guarantee a process CPU time with very strict constraints, this is all for naught. Your process could be preempted immediately after any call giving you some sort of nanosecond precise timing. By the time your next instruction runs, the sampling, timer value, etc. may be woefully and misleadingly out of date. I don't wish to discourage your efforts, only get you thinking and temper your expectations.

-Lee
 

cpsmusic

macrumors newbie
Original poster
Feb 24, 2008
23
0
Thanks, mach_absolute_time is what I'm looking for.

I also realise that this timer can be inaccurate.

Cheers,

Chris
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.