# Precise timer in MacOS X



## Thamior (Oct 13, 2006)

Hi, I would like to know how to get access to high precision (less than msec step) timer in MacOS X, similar to this for Windows. Also I program in C++ and not familiar at all with Objective-C and Cocoa. Just have to port an app to MacOS X.
I found out that it is possible with core foundation library, CFRunLoop. But also there are no good examples of it on the net. Also I'm not familiar with thread programming. So pease could you write here a simple example of using it. Thanks in advance.


----------



## szymczyk (Oct 13, 2006)

Mac OS X has two functions you can use for high precision timing: Microseconds() and UpTime(). These are C functions so you don't have to use Objective C or Cocoa. I wrote an article that shows you how to use Microseconds() and UpTime().


----------

