Created
January 22, 2014 17:04
-
-
Save JohnMurray/8562630 to your computer and use it in GitHub Desktop.
Simple timing wrapper for synchronous operations
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
def timing[A](x: => A): Int = { | |
import com.github.nscala_time.time.Imports._ | |
import org.joda.time.PeriodType | |
val then = LocalDateTime.now | |
x | |
new Period(then, LocalDateTime.now, PeriodType.millis).getValue(0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment