File tree 2 files changed +3
-3
lines changed
kotlinx-coroutines-core/jvm/test/guide
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ import kotlinx.coroutines.*
338
338
fun main () = runBlocking {
339
339
repeat(100_000 ) { // launch a lot of coroutines
340
340
launch {
341
- delay(1000L )
341
+ delay(5000L )
342
342
print (" ." )
343
343
}
344
344
}
@@ -351,7 +351,7 @@ fun main() = runBlocking {
351
351
352
352
<!-- - TEST lines.size == 1 && lines[0] == ".".repeat(100_000) -->
353
353
354
- It launches 100K coroutines and, after a second , each coroutine prints a dot.
354
+ It launches 100K coroutines and, after 5 seconds , each coroutine prints a dot.
355
355
356
356
Now, try that with threads. What would happen? (Most likely your code will produce some sort of out-of-memory error)
357
357
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import kotlinx.coroutines.*
10
10
fun main () = runBlocking {
11
11
repeat(100_000 ) { // launch a lot of coroutines
12
12
launch {
13
- delay(1000L )
13
+ delay(5000L )
14
14
print (" ." )
15
15
}
16
16
}
You can’t perform that action at this time.
0 commit comments