Skip to content

Instantly share code, notes, and snippets.

@pokutuna
Created February 13, 2011 17:20
Show Gist options
  • Save pokutuna/824855 to your computer and use it in GitHub Desktop.
Save pokutuna/824855 to your computer and use it in GitHub Desktop.
object Timing {
def measure[T](taskName:String)(exec: => T):Unit = {
val begin = System.currentTimeMillis()
val result = exec
val end = System.currentTimeMillis()
println(taskName + ": " + (end - begin).toFloat / 1000 + " sec")
return result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment