I’m trying to create a control method that executes submethods in separate threads. I have looked into NSTimer, but a couple of the submethods are not being executed in an exact time interval.
Here are the 5 intervals:
- Executes rapidly — ~ every 0.1 seconds
- Executes every 5 minutes
- Executes every 10 minutes
- Executes every hour on the hour
- Executes every day on the day (at midnight)
Interval 1 – 3 should be very easy to do with the NSTimer. Any tips for implementing the other ones?
Thanks in advance!
For (4) and (5), you want
dispatch_walltime, ifNSTimerisn’t being accurate enough.