[swcomp] The result of BenchmarkCommand.benchmark is now discardable

This commit is contained in:
Timofey Solomko
2022-01-13 22:43:14 +03:00
parent e3ada549fd
commit 8aa671a4e0
@@ -28,6 +28,7 @@ protocol BenchmarkCommand: Command {
func iterationSetUp()
@discardableResult
func benchmark() -> OutputType
func iterationTearDown()
@@ -113,7 +114,7 @@ extension BenchmarkCommand {
print(" ", terminator: "")
self.iterationSetUp()
let startTime = CFAbsoluteTimeGetCurrent()
_ = self.benchmark()
self.benchmark()
let timeElapsed = CFAbsoluteTimeGetCurrent() - startTime
let speed = benchmarkInputSize! / timeElapsed
print("\(formatter.string(fromByteCount: Int64(speed)))/s", terminator: "")