Use time to measure the execution time of a function once.
It is not accurate for short functions.
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.
SwiftTimeIt
A TimeIt function written in swift based loosely after IPython timeit magic.
Installation
In Swift Jupyter Notebook:
Usage
Use time to measure the execution time of a function once. It is not accurate for short functions.
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.
See TimeitExample.ipynb