Skip to content

my-mail-ru/swift-Benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Benchmark running times of Swift code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages