mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
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:
parent
42ca73da20
commit
c2c2a8c320
3 changed files with 111 additions and 74 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue