I have a simple app that doesn't do much more (at the moment) than create a timer:
_time = [[NSTimer alloc] initWithFireDate: _nextDate
interval: 0.0f
target: self
selector: @selector(trackTime)
userInfo: nil
repeats: NO];
[[NSRunLoop currentRunLoop] addTimer:_time forMode:NSRunLoopCommonModes];
In the trackTime function I checked to see how much difference there is between the stated firing date (_nextDate) and the actual firing date:
NSTimeInterval secondsBetween = [_nextDate timeIntervalSinceDate:[NSDate date]];
From the results, it appears that the function is called 2 to 4 seconds too late.
Is this normal? Do I need a different runloop mode? Is there anything else I can do to get a better timing?