Skip to content

Instantly share code, notes, and snippets.

@jimmydivvy
Created July 1, 2014 01:07
Show Gist options
  • Save jimmydivvy/06509d11689614d3b558 to your computer and use it in GitHub Desktop.
Save jimmydivvy/06509d11689614d3b558 to your computer and use it in GitHub Desktop.
import scalaz._, Scalaz._
def bench[T](fn: => T):(T,Long) = {
val start = System.currentTimeMillis()
val result = fn
val end = System.currentTimeMillis()
(result, end - start)
}
val (result, time) = bench{List(Option(1)).traverse(x => x)}
// time = 150ms!?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment