All Downloads are FREE. Search and download functionalities are using the official Maven repository.

indix.rocksdb.TimerUtil.scala Maven / Gradle / Ivy

There is a newer version: 5
Show newest version
package indix.rocksdb

object TimerUtil {

  def timed[T](report: (Long) => Unit)(block: => T): (Long, T) = {
    val start = System.nanoTime()
    val result = block
    val timeTookInMillis = (System.nanoTime() - start) / (1000 * 1000)

    report(timeTookInMillis)
    (timeTookInMillis, result)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy