Created
January 1, 2019 08:23
-
-
Save AmatsuZero/56b919174a8eed1b82024639ec12922c to your computer and use it in GitHub Desktop.
DispatchTime 便捷方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension DispatchTime: ExpressibleByIntegerLiteral { | |
public init(integerLiteral value: Int) { | |
self = DispatchTime.now() + .seconds(value) | |
} | |
} | |
extension DispatchTime: ExpressibleByFloatLiteral { | |
public init(floatLiteral value: Double) { | |
self = DispatchTime.now() + .milliseconds(Int(value * 1000)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment