func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any
The code snippet says , the interval will invoke the block every 0.5 seconds
// Invoke callback every half second
let interval = CMTime(seconds: 0.5,
preferredTimescale: CMTimeScale(NSEC_PER_SEC))
If you check the debug logs , and the structure interval holds the following values.
The Value turns out to be 500000000
The timeScale turns out to be 1000000000
Can some one explain how it will give exact 0.5 seconds? As I understand it as 500000000 units each of 1/1000000000