First find out how many milliseconds is that time stamp since now:
let secondsSinceNow = Date(timeIntervalSince1970: TimeInterval(timestampInMilliseconds)).timeIntervalSinceNow
let millisSinceNow = Int(secondsSinceNow * 1000)
Then you can get your dispatch time by adding to .now()
:
let dispatchTime: DispatchTime = .now() + .milliseconds(millisSinceNow)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…