What's the equivalent of Windows' QueryPerformanceCounter on OSX?

Paolo picture Paolo · Jan 21, 2009 · Viewed 27.3k times · Source

I'm porting a library from Windows to *NIX (currently OSX), does anyone now what function can I use instead of Microsoft's QueryPerformanceCounter and QueryPerformanceFrequency?

Answer

Justicle picture Justicle · May 12, 2011

On OSX mach_absolute_time and mach_timebase_info are the best equivalents to Win32 QueryPerformance* functions.

See http://developer.apple.com/library/mac/#qa/qa1398/_index.html