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
def avgTime(message: String, f: => Any) { | |
var avg = 0L | |
val c = 42 | |
1 to c foreach { | |
_ => | |
val t0 = System.nanoTime() | |
f | |
val t1 = System.nanoTime() | |
avg += t1 - t0 | |
} |
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
def avgTime(message: String, f: => Any) { | |
var avg = 0L | |
val c = 42 | |
1 to c foreach { | |
_ => | |
val t0 = System.nanoTime() | |
f | |
val t1 = System.nanoTime() | |
avg += t1 - t0 |