Skip to content

Instantly share code, notes, and snippets.

View baskakov's full-sized avatar

Dmitry Baskakov baskakov

  • Bask Digital Agency
  • Heidelberg, Germany
View GitHub Profile
@baskakov
baskakov / gist:8437349
Created January 15, 2014 14:34
Sum by keys
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
@baskakov
baskakov / gist:8437895
Created January 15, 2014 15:05
Sum by keys
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
}