Created
March 1, 2013 02:35
-
-
Save aphexmunky/5062072 to your computer and use it in GitHub Desktop.
Scala functional timer wrapper
This file contains 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
object Timer { | |
def timer(t: => Any) = { | |
val start = System.currentTimeMillis | |
val func = t | |
val end = System.currentTimeMillis | |
println("function took " + (end - start) + " milliseconds") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment