 	return elapsedNano
 }
 
-private func adjustPrecision(ns: Int, toPrecision: String) -> Int
+private func adjustPrecision(_ ns: Int, toPrecision: String) -> Int
 {
 	switch toPrecision
 	{

	}
}

func benchmark(precision: String = "ms", _ call: () -> ()) -> Int
{
	// empty call duration to subtract
	let emptyCallNano = performanceInNs({})
	let elapsedNano = performanceInNs(call)

	let elapsedCorrected = elapsedNano < emptyCallNano ? 0 : elapsedNano - emptyCallNano

	return adjustPrecision(elapsedCorrected, toPrecision: precision)
}

func benchmarkPrint(precision: String = "ms", title: String, _ call: () -> ())
{
	print(title + ": \(benchmark(precision, call))" + precision)
}

func benchmarkAvg(precision: String = "ms",
	title: String = "",
	times: Int = 100,
	_ call: () -> ()) -> (min: Int, avg: Int, max: Int)
{
	let emptyCallsNano = performanceInNs(
	{
		for _ in 0..<times {}
	})

/*
	————————————————————————————————————————————————————————————
	BenchmarkTools.swift
	————————————————————————————————————————————————————————————
	Created by Marcel Kröker on 03.04.15.
	Copyright (c) 2015 Blubyte. All rights reserved.
*/

import Foundation

private func durationNS(_ call: () -> ()) -> Int
{
	var start = UInt64()
	var end = UInt64()
