daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun main(args: Array<String>) {
  2.     var assign: String
  3.     val time = measureTimeMillis {
  4.         assign = "Value Assigned"
  5.     }
  6.     println("$time ms. spent assigning: '$assign!!'")
  7. }
  8.  
  9. private inline fun measureTimeMillis(block: () -> Unit): Long {
  10.     val start = System.currentTimeMillis()
  11.     block()
  12.     return System.currentTimeMillis() - start
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top