Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun main(args: Array<String>) = runBlocking<Unit> {
- val time = measureTimeMillis {
- val one = doSomethingUsefulOne()
- val two = doSomethingUsefulTwo()
- println("The answer is ${one + two}")
- }
- println("Completed in $time ms")
- }
- suspend fun doSomethingUsefulOne(): Int {
- delay(1000L)
- return 13
- }
- suspend fun doSomethingUsefulTwo(): Int {
- delay(1000L)
- return 29
- }
Add Comment
Please, Sign In to add comment