summaryrefslogtreecommitdiff
path: root/src/main/scala/com/nsrddyn/tools/Benchmark.scala
blob: 5d7906a878964ea236100f4ef6b7c5e4a4b44172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.nsrddyn.tools

class Benchmark {

  // add a reference to a function
  def measure(work: => Unit): Long = {

    val start = System.nanoTime()
    work
    val end = System.nanoTime()
    end - start
  } 

}