I was recording a sample of CMDeviceMotion
acceleration data for 30 seconds through NSTimer
. The thing is, when the app is in foreground, everything is fine. The interval is set to 0.01
and in 30 seconds
, 3000
readings are stored. But when app goes to background, I get 300
only readings.
self.deviceMotionTimer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(recordUpdates) userInfo:nil repeats:YES];
Is this how NSTimer works?