File tree 2 files changed +4
-4
lines changed
kotlinx-coroutines-core/jvm/test/guide
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,18 @@ import kotlinx.coroutines.*
9
9
import kotlin.system.*
10
10
11
11
fun main () = runBlocking<Unit > {
12
- // sampleStart
12
+ // sampleStart
13
13
val time = measureTimeMillis {
14
14
println (" The answer is ${concurrentSum()} " )
15
15
}
16
16
println (" Completed in $time ms" )
17
- // sampleEnd
17
+ // sampleEnd
18
18
}
19
19
20
20
suspend fun concurrentSum (): Int = coroutineScope {
21
21
val one = async { doSomethingUsefulOne() }
22
22
val two = async { doSomethingUsefulTwo() }
23
- one.await() + two.await()
23
+ one.await() + two.await()
24
24
}
25
25
26
26
suspend fun doSomethingUsefulOne (): Int {
Original file line number Diff line number Diff line change @@ -28,5 +28,5 @@ suspend fun failedConcurrentSum(): Int = coroutineScope {
28
28
println (" Second child throws an exception" )
29
29
throw ArithmeticException ()
30
30
}
31
- one.await() + two.await()
31
+ one.await() + two.await()
32
32
}
You can’t perform that action at this time.
0 commit comments