Created
June 6, 2022 07:16
-
-
Save Shilo/3051650f3f889d30ddb4d9e10e3335f4 to your computer and use it in GitHub Desktop.
Swift extension for Task sleeping in milliseconds.
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
// | |
// Task+Addition.swift | |
// | |
// | |
// Created by Shilo White on 6/5/22. | |
// | |
import Foundation | |
public extension Task where Success == Never, Failure == Never { | |
static func sleep(milliseconds duration: UInt64) async throws { | |
try await sleep(nanoseconds: duration * 1000000) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment