Skip to content
A simple statistical time-based benchmarking framework
Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CBHBenchmarkKit.xcodeproj
CBHBenchmarkKit
CBHBenchmarkKitTests
.gitattributes
.gitignore
CBHBenchmarkKit.podspec
LICENSE
README.md

README.md

CBHBenchmarkKit

release pod licence coverage

A simple statistical time-based benchmarking framework with nanosecond precision.

Example:

Sample the amount of time to create and fill and array with 10000 entries.

CBHBenchmarkSamples *benchmark = [CBHBenchmark benchmark:^{
	NSMutableArray *array = [NSMutableArray array];
	for (NSUInteger i = 0; i < 10000; ++i)
	{
		[array addObject:[NSString stringWithFormat:@"%lu", i]];
	}
}];


/// Samples
NSUInteger count = [benchmark count];
NSArray<CBHBenchmarkSample *> *samples = [benchmark samples];
NSArray<CBHBenchmarkSample *> *sortedSamples = [benchmark sortedSamples];


/// Max, Min, and Range
CBHBenchmarkSample *min = [benchmark min];
CBHBenchmarkSample *max = [benchmark max];
CBHBenchmarkDuration *spread = [benchmark spread];


/// Mean and Median
CBHBenchmarkDuration *mean = [benchmark mean];
CBHBenchmarkDuration *median = [benchmark median];


/// Variance, Standard Deviation, Standard Error
CGFloat variance = [benchmark variance];
CBHBenchmarkDuration *standardDeviation = [benchmark standardDeviation];
CBHBenchmarkDuration *standardError = [benchmark standardError];

Licence

CBHBenchmarkKit is available under the ISC license.

You can’t perform that action at this time.