Skip to content

Instantly share code, notes, and snippets.

@hkupty
Created March 7, 2016 14:50
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 hkupty/4875eed94d8aaaf59a06 to your computer and use it in GitHub Desktop.
Save hkupty/4875eed94d8aaaf59a06 to your computer and use it in GitHub Desktop.
def time[A](a: => A) = {
val now = System.nanoTime
val result = a
val micros = (System.nanoTime - now) / 1000
println("%d microseconds".format(micros))
result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment