C++ Performance timer and mac?

Im looking for the mac version of the Win32 QueryPerformanceFrequency, and QueryPerformanceCounter. To use for a VERY accurate time catcher. Does anyone know of one ( and a tutorial or walk though on it ) for OS X? Please and thank you.

How accurate do you need? I’ve always found gettimeofday (POSIX), GetCurrentEventTime() (Carbon) and +[NSDate timeIntervalSinceReferenceDate] (Cocoa) to be plenty accurate enough for my timing needs.

Other than those, you could use Microseconds (Carbon), Uptime (Carbon), or just read the TBR and compensate for clock speed yourself…

Here’s a tutorial, a bit old but it should cover Uptime, Microseconds & TBR (that is, the complicated ways ) well: http://www.idevgames.com/content/download.php?id=124

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.