Last active
October 20, 2019 09:19
-
-
Save streetsmartdev/83ab1af6ebf801e4cf586e1a8fcaf89c to your computer and use it in GitHub Desktop.
This file contains 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(args: Array<String>) { | |
val methodTime = measureTimeMillis { | |
val apiResult = runBlocking(Dispatchers.Default) { | |
val asyncResult = async { callApi() } | |
asyncResult.await() | |
} | |
println(apiResult) | |
} | |
println("Time: ${methodTime}ms") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment