Created
October 21, 2022 02:14
-
-
Save alokomkar/230460b08b96af4580d44685603611a8 to your computer and use it in GitHub Desktop.
Suspending functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun main() = runBlocking { // this: CoroutineScope | |
| launch { doWorld() } | |
| println("Hello") | |
| } | |
| // this is your first suspending function | |
| suspend fun doWorld() { | |
| delay(1000L) | |
| println("World!") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment