Skip to content

Commit 5039855

Browse files
authored
minor fix for doc and sample code (#3728)
1 parent 4bc89e2 commit 5039855

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/topics/select-expression.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ the first one that becomes available.
1313

1414
## Selecting from channels
1515

16-
Let us have two producers of strings: `fizz` and `buzz`. The `fizz` produces "Fizz" string every 300 ms:
16+
Let us have two producers of strings: `fizz` and `buzz`. The `fizz` produces "Fizz" string every 500 ms:
1717

1818
```kotlin
1919
fun CoroutineScope.fizz() = produce<String> {
20-
while (true) { // sends "Fizz" every 300 ms
21-
delay(300)
20+
while (true) { // sends "Fizz" every 500 ms
21+
delay(500)
2222
send("Fizz")
2323
}
2424
}
2525
```
2626

27-
And the `buzz` produces "Buzz!" string every 500 ms:
27+
And the `buzz` produces "Buzz!" string every 1000 ms:
2828

2929
```kotlin
3030
fun CoroutineScope.buzz() = produce<String> {
31-
while (true) { // sends "Buzz!" every 500 ms
32-
delay(500)
31+
while (true) { // sends "Buzz!" every 1000 ms
32+
delay(1000)
3333
send("Buzz!")
3434
}
3535
}
@@ -62,14 +62,14 @@ import kotlinx.coroutines.channels.*
6262
import kotlinx.coroutines.selects.*
6363

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

7171
fun CoroutineScope.buzz() = produce<String> {
72-
while (true) { // sends "Buzz!" every 500 ms
72+
while (true) { // sends "Buzz!" every 1000 ms
7373
delay(1000)
7474
send("Buzz!")
7575
}

0 commit comments

Comments
 (0)