Skip to content

Commit 9e886f1

Browse files
authored
Update select-guide timings to be precise (#3387)
Fixes #3385
1 parent 521ee78 commit 9e886f1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/topics/select-expression.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ import kotlinx.coroutines.selects.*
6363

6464
fun CoroutineScope.fizz() = produce<String> {
6565
while (true) { // sends "Fizz" every 300 ms
66-
delay(300)
66+
delay(500)
6767
send("Fizz")
6868
}
6969
}
7070

7171
fun CoroutineScope.buzz() = produce<String> {
7272
while (true) { // sends "Buzz!" every 500 ms
73-
delay(500)
73+
delay(1000)
7474
send("Buzz!")
7575
}
7676
}
@@ -112,7 +112,7 @@ fizz -> 'Fizz'
112112
fizz -> 'Fizz'
113113
buzz -> 'Buzz!'
114114
fizz -> 'Fizz'
115-
buzz -> 'Buzz!'
115+
fizz -> 'Fizz'
116116
```
117117

118118
<!--- TEST -->

kotlinx-coroutines-core/jvm/test/guide/example-select-01.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import kotlinx.coroutines.selects.*
1111

1212
fun CoroutineScope.fizz() = produce<String> {
1313
while (true) { // sends "Fizz" every 300 ms
14-
delay(300)
14+
delay(500)
1515
send("Fizz")
1616
}
1717
}
1818

1919
fun CoroutineScope.buzz() = produce<String> {
2020
while (true) { // sends "Buzz!" every 500 ms
21-
delay(500)
21+
delay(1000)
2222
send("Buzz!")
2323
}
2424
}

kotlinx-coroutines-core/jvm/test/guide/test/SelectGuideTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SelectGuideTest {
1818
"fizz -> 'Fizz'",
1919
"buzz -> 'Buzz!'",
2020
"fizz -> 'Fizz'",
21-
"buzz -> 'Buzz!'"
21+
"fizz -> 'Fizz'"
2222
)
2323
}
2424

0 commit comments

Comments
 (0)