• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 // This file was automatically generated from coroutines-basics.md by Knit tool. Do not edit.
6 package kotlinx.coroutines.guide.exampleBasic04
7 
8 import kotlinx.coroutines.*
9 
10 // Sequentially executes doWorld followed by "Done"
<lambda>null11 fun main() = runBlocking {
12     doWorld()
13     println("Done")
14 }
15 
16 // Concurrently executes both sections
doWorldnull17 suspend fun doWorld() = coroutineScope { // this: CoroutineScope
18     launch {
19         delay(2000L)
20         println("World 2")
21     }
22     launch {
23         delay(1000L)
24         println("World 1")
25     }
26     println("Hello")
27 }
28