2

I'm looking to create functionality that gets repeated very quickly - around 50ms. I need, however, as much consistency as possible in the call and I have found NSTimer to be a bit erratic. It seems I might find some help with keeping time from mach_absolute_time. Any tips on using this to create an extremely accurate timer?

Community
  • 1
  • 1
colt
  • 89
  • 1
  • 9

1 Answers1

1

Have you had a look at GCD, specifically dispatch_source_create()?

http://developer.apple.com/library/ios/documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html#//apple_ref/c/func/dispatch_source_create

hypercrypt
  • 15,389
  • 6
  • 48
  • 59
  • That's a good call, I haven't had a lot of GCD experience but there is a section on timers on [this doc](http://developer.apple.com/library/mac/#documentation/General/Conceptual/ConcurrencyProgrammingGuide/GCDWorkQueues/GCDWorkQueues.html) which seem to give a pretty accurate alternative to NSTimer. Thanks. – colt Jul 01 '12 at 00:40