NSTimer is firing twice...
NSTimer is firing twice...
- Subject: NSTimer is firing twice...
- From: Jonathan del Strother <email@hidden>
- Date: Thu, 1 Jan 2004 16:12:43 +0000
I have an NSTimer, set to fire once a second:
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self
selector:@selector(updateFpsCounter) userInfo:nil repeats:true];
The function that it calls updates a counter in my interface:
- (void)updateFpsCounter
{
NSLog(@"Updating FPS");
[fps setStringValue:[NSString stringWithFormat:@"%i fps \n %i tps",
frameCount, tickCount]];
frameCount = 0;
tickCount = 0;
}
However, the timer is firing twice in quick succession. Here's my
output log :
2004-01-01 16:05:16.549 Emergence[2844] Updating FPS
2004-01-01 16:05:16.561 Emergence[2844] Updating FPS
2004-01-01 16:05:17.549 Emergence[2844] Updating FPS
2004-01-01 16:05:17.561 Emergence[2844] Updating FPS
2004-01-01 16:05:18.570 Emergence[2844] Updating FPS
2004-01-01 16:05:18.581 Emergence[2844] Updating FPS
- it seems to be calling the function twice, a few milliseconds apart.
Any ideas what might cause this?
Thanks,
Jon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.