Skip to content

Commit

Permalink
Adding separator as a val
Browse files Browse the repository at this point in the history
Signed-off-by: Sayed Bilal Bari <[email protected]>
  • Loading branch information
bilalbari committed Jul 11, 2024
1 parent 73d3992 commit 3d9290f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class Benchmark(
*/
def measure(name: String, overrideNumIters: Int)(f: ToolsTimer => Unit): Result = {
System.gc() // ensures garbage from previous cases don't impact this one
val separator = "-" * 80
for (wi <- 0 until warmUpIterations) {
f(new ToolsTimer(-1))
}
Expand All @@ -111,14 +112,14 @@ class Benchmark(
gcCounts += memoryTracker.getTotalGCCount
gcTimes += memoryTracker.getTotalGCTime
if (outputPerIteration) {
println("*"*80)
println(separator)
println(s"Iteration $i took ${NANOSECONDS.toMicros(runTime)} microseconds")
println("*"*80)
println(separator)
}
}
println("*"*80)
println(separator)
println(s" Stopped after $minIters iterations, ${NANOSECONDS.toMillis(runTimes.sum)} ms")
println("*"*80)
println(separator)
assert(runTimes.nonEmpty)
val bestRuntime = runTimes.min
val avgRuntime = runTimes.sum / runTimes.size
Expand Down

0 comments on commit 3d9290f

Please sign in to comment.