Sadat
Sadat

Reputation: 3481

minimum effective schedule interval ( iphone objective c )

I think there is a minimum time span that we can assign as interval to schedule a task in iPhone SDK. But I haven't found that minimum interval/time span yet.

Would you let me know please! It will be very helpful to me.

EDIT

Any detail reference is more appreciative. Thanks in advance

Upvotes: 1

Views: 1752

Answers (2)

nschum
nschum

Reputation: 15422

NSTimeInterval is just a "double", so can specify any double value. The smallest value next to 0 is about 2.225e-308.

However, remember that NSTimer is not a high-precision tool. You can specify very small intervals, but they aren't honored by the OS. Here's what the documentation for NSTimer says:

the effective resolution of the time interval for a timer is limited to on the order of 50-100 milliseconds

Upvotes: 3

Steve
Steve

Reputation: 31652

0.0 I believe. I've seen this used as a "trick" to get the system to run something immediately after the current thread goes into a wait state.

http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/performSelector:withObject:afterDelay:

"The minimum time before which the message is sent. Specifying a delay of 0 does not necessarily cause the selector to be performed immediately. The selector is still queued on the thread’s run loop and performed as soon as possible."

The implication is, you can specify 0.

Upvotes: 2

Related Questions