mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
[swcomp] The result of BenchmarkCommand.benchmark is now discardable
This commit is contained in:
@@ -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: "")
|
||||
|
||||
Reference in New Issue
Block a user