Minor optimisations and bugfixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4889 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-09-14 10:03:02 +00:00
parent 42ca73da20
commit c2c2a8c320
3 changed files with 111 additions and 74 deletions

View file

@ -28,19 +28,30 @@
#include <Foundation/NSRunLoop.h>
#include <Foundation/NSInvocation.h>
@class NSGDate;
static Class NSDate_class;
@implementation NSTimer
+ (void) initialize
{
if (self == [NSTimer class])
{
NSDate_class = [NSGDate class];
}
}
/* This is the designated initializer. */
- initWithTimeInterval: (NSTimeInterval)seconds
targetOrInvocation: t
selector: (SEL)sel
userInfo: info
repeats: (BOOL)f
- (id) initWithTimeInterval: (NSTimeInterval)seconds
targetOrInvocation: (id)t
selector: (SEL)sel
userInfo: info
repeats: (BOOL)f
{
if (seconds <= 0)
seconds = 0.01;
seconds = 0.001;
_interval = seconds;
_date = [[NSDate allocWithZone: [self zone]]
_date = [[NSDate_class allocWithZone: [self zone]]
initWithTimeIntervalSinceNow: seconds];
_target = t;
_selector = sel;