46 if ((
self = [super init]))
50 now = [UNIVERSE getTime];
86 NSString *intervalDesc =
nil;
88 if (
_interval <= 0.0) intervalDesc =
@"one-shot";
89 else intervalDesc = [
NSString stringWithFormat:@"interval: %g", _interval];
91 return [
NSString stringWithFormat:@"nextTime: %g, %@, %srunning", _nextTime, intervalDesc, _isScheduled ? "" : "not "];
142 [sDeferredTimers addObject:
self];
171 now = [UNIVERSE getTime];
203 NSArray *timers =
nil;
204 NSEnumerator *timerEnum =
nil;
209 for (timerEnum = [timers objectEnumerator]; (timer = [
timerEnum nextObject]); )
221 now = [UNIVERSE getTime];
228 scaled = ceil(scaled);
248 @catch (NSException *exception)
250 OOLog(
kOOLogException,
@"\n\n***** Ignoring Timer Exception: %@ : %@ *****\n\n",[exception name], [exception reason]);
253 if (
_nextTime < otherTime)
return NSOrderedAscending;
254 else if (
_nextTime > otherTime)
return NSOrderedDescending;
255 else return NSOrderedSame;
NSString *const kOOLogException
#define OOLogGenericSubclassResponsibility()
#define OOLog(class, format,...)
static NSMutableArray * sDeferredTimers
static OOPriorityQueue * sTimers
void removeExactObject:(id object)
void addObject:(id object)
void addObjects:(id collection)
NSArray * sortedObjects()
BOOL isValidForScheduling()
NSString * descriptionComponents()
OOTimeAbsolute nextTime()
id initWithNextTime:interval:(OOTimeAbsolute nextTime,[interval] OOTimeDelta interval)