Created
July 1, 2014 01:07
-
-
Save jimmydivvy/06509d11689614d3b558 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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