File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,18 @@ extension Clock {
6767 /// await someWork()
6868 /// }
6969 @available ( SwiftStdlib 5 . 7 , * )
70+ @_alwaysEmitIntoClient
7071 public func measure(
72+ isolation: isolated ( any Actor ) ? = #isolation,
73+ _ work: ( ) async throws -> Void
74+ ) async rethrows -> Instant . Duration {
75+ try await measure ( work)
76+ }
77+
78+ @available ( SwiftStdlib 5 . 7 , * )
79+ @_unsafeInheritExecutor
80+ @usableFromInline
81+ internal func measure(
7182 _ work: ( ) async throws -> Void
7283 ) async rethrows -> Instant . Duration {
7384 let start = now
Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift -strict-concurrency=complete -disable-availability-checking -parse-as-library
12// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library)
23
34// REQUIRES: concurrency
1213import _Concurrency
1314import StdlibUnittest
1415
15- var tests = TestSuite ( " Time " )
16+ @ MainActor var tests = TestSuite ( " Time " )
1617
1718@main struct Main {
1819 static func main( ) async {
You can’t perform that action at this time.
0 commit comments