Benchmark

master

Benchmark running times of Swift code
my-mail-ru/swift-Benchmark

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)

Description

  • Swift Tools 4.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Oct 19 2024 07:16:37 GMT-0900 (Hawaii-Aleutian Daylight Time)