in fixtures/benchmarks/benches/bindings/run_benchmarks.swift [26:49]
func runTest(testCase: TestCase, count: UInt64) -> UInt64 {
let data = TestData(foo: "StringOne", bar: "StringTwo")
let start: clock_t
switch testCase {
case TestCase.function:
start = clock()
for _ in 0...count {
testFunction(a: 10, b: 20, data: data)
}
case TestCase.voidReturn:
start = clock()
for _ in 0...count {
testVoidReturn(a: 10, b: 20, data: data)
}
case TestCase.noArgsVoidReturn:
start = clock()
for _ in 0...count {
testNoArgsVoidReturn()
}
}
let end = clock()
return UInt64((end - start) * 1000000000 / CLOCKS_PER_SEC)
}