I was sure that this question was asked earlier, so of course I used the search function to check if there is an answer that solves my problem.
However, all I could find was a lot of answers to measuring time with high accuracy.
What I need is a high-resolution timer (at least milliseconds) that allows me to activate a callback when a certain period of time has passed. I would like to use this in a Cocoa Mac OS X application, so C / C ++ or Obj-C will be possible. If additional libraries are needed, this is also good.
I found this http://www.songho.ca/misc/timer/timer.html , but it used a lively wait strategy and would cost too much performance, I guess.
Help is greatly appreciated!
source
share