2017-12-19 4 views
1

私が使用して作成されDispatchSourceTimerを実行していますDispatchSourceTimerを実行しているときのscheduleRepeating()の呼び出しの動作?

self.timer = DispatchSource.makeTimerSource(flags: .init(rawValue: 0), queue: self.myQueue) 
self.timer!.scheduleRepeating(deadline: .now(), interval: .milliseconds(100)) 
self.timer!.setEventHandler(handler: self.myHandler) 

私が呼び出したときに何が起こる:

self.timer!.scheduleRepeating(deadline: .now(), interval: .milliseconds(100)) 

後の時間に?タイマーをリセットし、「ミリ秒単位でカウント」を開始しますか?

iOS documentationは何も説明しません。

答えて

1

短い答え:

はい、それはタイマーをリセットし、それはあなたが遊び場にそれを自分でテストすることができ


再起動します...

関連する問題