Skip to content

Instantly share code, notes, and snippets.

@streetsmartdev
Last active October 20, 2019 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save streetsmartdev/83ab1af6ebf801e4cf586e1a8fcaf89c to your computer and use it in GitHub Desktop.
Save streetsmartdev/83ab1af6ebf801e4cf586e1a8fcaf89c to your computer and use it in GitHub Desktop.
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