I would like to play a sound for only a short span of time, shorter than the duration of the sound file. Therefore, at the same time as I start playing, I would like to queue up a task that will stop the sound.
I see two choices for queuing up the stop method: NSTimer and performSelector:withObject:afterDelay:
Does anyone know which of the two is most likely to trigger on time, or have a higher priority? It is not imperative that I get called with millisecond accuracy, but accuracy to 0.1 second would be great.
Addendum: Does anyone know where I could find documentation on the priority of different timer and delay tasks? For example, how would the below rank:
- NSTimer tasks
- performSelector
- the calling of a view's drawRect after setNeedsDisplay has been called
- the calling of a layer's drawing routines after setNeedsDisplay has been called
- any other delayed tasks
And would it be useful to try to do this in a different thread?