Skip to content

Instantly share code, notes, and snippets.

@razvvan
Created December 16, 2013 10:45
Show Gist options
  • Select an option

  • Save razvvan/7985197 to your computer and use it in GitHub Desktop.

Select an option

Save razvvan/7985197 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