Timeit built in Swift

Hi all,

I was recently comparing the speed of some code written in Python, Pybind, Cython, and Swift. I realized that there was no good and standardized way to measure execution time in Swift. Thus, I built SwiftTimeit based off of the IPython Magic for timeit.

Here is what the timing looks like:

It is super simple to install in a swift notebook with just:

%install ‘.package(url: “https://github.com/bhansconnect/SwiftTimeit”, from: “1.0.0”)’ SwiftTimeit
import SwiftTimeit

Here is the link:

5 Likes