There is one label which display Score from 10,000 to 0 in 10 seconds (lblPoints)
NSTimer pointstimer=[[NSTimer scheduledTimerWithTimeInterval:0.001 target:self selector:@selector(pointstimermethod) userInfo:nil repeats:YES]retain];
-(void)pointstimermethod
{
points=points-1;
lblPoints.text=[NSString stringWithFormat:@"%d",points];
}
Can anyone show me how I can display 10,000 to 0 in exactly and precisely 10 seconds?
The display only updates at 60 Hz max, and NSTimer firing accuracy depends on what’s going on in the UI run loop, and thus may have errors of one to several display frame times (over 10 mS), certainly not 1 mS resolution. Lots of numbers between 10000 and 0 will be skipped since the device can only display 600 unique frames max in 10 seconds.
I would try using CADisplayLink set for a 60 Hz display update (that’s the max), check the current time using mach_time, subtract that from some start time, subtract that from 10.0 to get a count down, and display 1000X the difference in seconds until 0.0 seconds is reached.