Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 793 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 793 Bytes

Benchmark

Swift: 4.0 OS: Linux | macOS | iOS | watchOS | tvOS License: MIT

The Benchmark library provides a number of functions to help you figure out how long (both in terms of wallclock and CPU time) it takes to execute some code.

Functions

timethis

	func timethis(count: Int, title: String? = nil, _ body: () throws -> Void) rethrows

Run a chunk of code several times. Results will be printed to STDOUT.

	timethis(count: 3) {
		// do something
	}

	// Output:
	// 0.444793617 wallclock secs (0.308 usr + 0.004 sys = 0.312 CPU)