We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5741a3f commit 60572c7Copy full SHA for 60572c7
Samples/iOS-Swift/iOS-Swift/Tools/TriggerAppHang.swift
@@ -20,18 +20,7 @@ func triggerNonFullyBlockingAppHang() {
20
}
21
22
23
-/// Schedules heavy UI rendering work on the main thread in a tight loop, which causes
24
-/// a fully blocking app hang without frames being rendered.
+/// Sleep on the main thread for long enough to trigger a hang
25
func triggerFullyBlockingAppHang(button: UIButton) {
26
- let buttonTitle = button.currentTitle
27
- var i = 0
28
-
29
- for _ in 0...5_000_000 {
30
- i += Int.random(in: 0...10)
31
- i -= 1
32
33
- button.setTitle("\(i)", for: .normal)
34
- }
35
36
- button.setTitle(buttonTitle, for: .normal)
+ sleep(5)
37
0 commit comments