Fix badly implemented high resolution timer on Apple OSX and iOS.