I am trying to design a system where real-time events happen and I want to synchronise them to a clock. [NSDate date]
would normally be ok but the user could c
I think mach_absolute_time()
may be what you'll want. There is quite a bit of information here: http://developer.apple.com/library/mac/#qa/qa1398/_index.html
It is basically a counter of the number of ticks since the device started. This will be reset on reboot but other than that it is a monotonically increasing counter.
You can keep the last value of the counter around and deal with it if the counter has decreased since the last time (the device was restarted). In this case you can add the last known value to the current value to get a lower bound of the time that has elapsed, all you'd lose is the time between the last session and the device shut down, you would keep the time between the reboot and the next session though.