repeating timer with "run now"
repeating timer with "run now"
- Subject: repeating timer with "run now"
- From: Torsten Curdt <email@hidden>
- Date: Thu, 22 Aug 2013 15:36:52 +0200
I have some piece of code that I want to run every x seconds ....but I
also want to be able to trigger a "run now" that will reset the
upcoming cycle.
I think I would know plenty of ways to implement this (ranging from
simple NSTimer to select() style signaling to threading with
conditions) but I am looking for the most elegant way - preferably
with GCD.
Scheduling a block is easy with GCD - but can you also notify that
block for immediate execution later on?
Just would love to hear opinions on how you would tackle this
admittedly easy problem the most elegant way.
cheers,
Torsten
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden