Swiftpack.co - bhansconnect/SwiftTimeit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bhansconnect.
bhansconnect/SwiftTimeit 1.0.0
A TimeIt function written in swift based loosely after IPython timeit magic.
⭐️ 6
🕓 4 years ago
.package(url: "https://github.com/bhansconnect/SwiftTimeit.git", from: "1.0.0")

SwiftTimeIt

A TimeIt function written in swift based loosely after IPython timeit magic.

Installation

In Swift Jupyter Notebook:

%install '.package(url: "https://github.com/bhansconnect/SwiftTimeit", from: "1.0.0")' SwiftTimeit
import SwiftTimeit

Usage

Use time to measure the execution time of a function once. It is not accurate for short functions. Time Usage

Use timeit to accurately measure the execution time of a function. Timeit will atomacitically calculate the number of loops to run to get sufficient accuracy, if loops is not specified. Timeit will let you know if there is a large difference between best and worst case execution. Timeit Usage

See TimeitExample.ipynb

GitHub

link
Stars: 6
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics