diff --git a/docs/basics.md b/docs/basics.md index f171c2c29e..cb64328676 100644 --- a/docs/basics.md +++ b/docs/basics.md @@ -338,7 +338,7 @@ import kotlinx.coroutines.* fun main() = runBlocking { repeat(100_000) { // launch a lot of coroutines launch { - delay(1000L) + delay(5000L) print(".") } } @@ -351,7 +351,7 @@ fun main() = runBlocking { -It launches 100K coroutines and, after a second, each coroutine prints a dot. +It launches 100K coroutines and, after 5 seconds, each coroutine prints a dot. Now, try that with threads. What would happen? (Most likely your code will produce some sort of out-of-memory error) diff --git a/kotlinx-coroutines-core/jvm/test/guide/example-basic-08.kt b/kotlinx-coroutines-core/jvm/test/guide/example-basic-08.kt index ff11eb70d7..bb7786f28a 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/example-basic-08.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/example-basic-08.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.* fun main() = runBlocking { repeat(100_000) { // launch a lot of coroutines launch { - delay(1000L) + delay(5000L) print(".") } }