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 {
67
67
/// await someWork()
68
68
/// }
69
69
@available ( SwiftStdlib 5 . 7 , * )
70
+ @_alwaysEmitIntoClient
70
71
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(
71
82
_ work: ( ) async throws -> Void
72
83
) async rethrows -> Instant . Duration {
73
84
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
1
2
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library)
2
3
3
4
// REQUIRES: concurrency
12
13
import _Concurrency
13
14
import StdlibUnittest
14
15
15
- var tests = TestSuite ( " Time " )
16
+ @ MainActor var tests = TestSuite ( " Time " )
16
17
17
18
@main struct Main {
18
19
static func main( ) async {
You can’t perform that action at this time.
0 commit comments