Last Updated: February 25, 2016
· amirtcheva

"Timer" in Scala

I was looking for a Timer class in Scala, equivalent to those in Java, and all I could find is this:$Timer

It seems like it doesn't come as part of the standard Utils library, so I used:

var now = System.nanoTime

var timeElapsed = System.nanoTime - now

To find the time elapsed between two pieces of code