Last active
September 19, 2019 05:40
-
-
Save CanerPatir/97187c54a7d5f70efdde134e1b900a0c to your computer and use it in GitHub Desktop.
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
| suspend fun doOperation1() { | |
| delay(1000L) | |
| } | |
| suspend fun getSomeResult(): String { | |
| delay(2000L) | |
| return "hello" | |
| } | |
| fun main(){ | |
| runBlocking { | |
| doOperation1() | |
| println("operation1 done after 1 second") | |
| val result = getSomeResult() | |
| println("operation2 done after 2 seconds and result: $result") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment