Guest User

Untitled

a guest
Jan 23rd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. fun main(args: Array<String>) = runBlocking<Unit> {
  2. val time = measureTimeMillis {
  3. val one = doSomethingUsefulOne()
  4. val two = doSomethingUsefulTwo()
  5. println("The answer is ${one + two}")
  6. }
  7. println("Completed in $time ms")
  8. }
  9.  
  10. suspend fun doSomethingUsefulOne(): Int {
  11. delay(1000L)
  12. return 13
  13. }
  14.  
  15. suspend fun doSomethingUsefulTwo(): Int {
  16. delay(1000L)
  17. return 29
  18. }
Add Comment
Please, Sign In to add comment