我有以下代码:
[NSTimer scheduleTimerWithTimeInterval:0.5 target:self 选择器:@selector(timerCount:) userInfo:nil repeats:YES]; -(void)timerCount:(NSTimer *)timer { NSTimeInterval dt = [定时器时间间隔]; // 做一点事 }
我得到的 NSTimeInterval 将是 0.5,这是我在 scheduleTimerWithInterval 上设置的时间间隔,这意味着每 0.5 秒将调用一次 timerCount。
但是我现在有一些东西作为时间戳,我想知道 NSTimer 是否会在每次精确 0.5 秒内调用 timerCount 方法。