According to the docs, a NSTimer may be inaccurate, it fires when the system is idle enough to do so.
What you can do if are really dependant on exact time values: Create a timer and let it fire once a second. In the fired method ask for the exact system time and do your processing with it. This way you get always accurate time values independent of the accuracy of the timer events.
Some sample code: It stores the system time of the timer start. In the update
method compute the exact time difference since timer start. So you get accurate values.
var timer: NSTimer?
var timerStart: NSDate?
func startTimer() {
// get current system time
self.timerStart = NSDate()
// start the timer
self.timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("update:"), userInfo: nil, repeats: true)
}
func update() {
// get the current system time
let now = NSDate()
// get the seconds since start
let seconds = now.timeIntervalSinceDate(self.timerStart)
...
}