Skip to content

Commit 9eeac18

Browse files
committed
Add a warning message if the elapsed time is 0
1 parent 65f05b3 commit 9eeac18

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

benchmark/utils/DriverUtils.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ func runBench(_ name: String, _ fn: (Int) -> Void, _ c: TestConfig) -> BenchResu
308308
if elapsed_time > 0 {
309309
scale = UInt(time_per_sample / elapsed_time)
310310
} else {
311+
if c.verbose {
312+
print(" Warning: elapsed_time was 0. You can safely ignore the result if the body is empty.")
313+
}
311314
scale = 1
312315
}
313316
} else {

0 commit comments

Comments
 (0)