| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168739Image: ubuntu2004
Adapting a useful trick, we attempt to set up analogues of IPython's "magic" %timeit function for notebook cells. See timeit for documentation on the underlying Python library module.
First, we wrap an existing Sage library function:
625 loops, best of 3: 16.9 µs per loop
1 loops, best of 3: 996 ms per loop
Here's an alternative, with sample statistics computed for repeat iterations:
r = 10, mean = 0.108, std. dev. = 0.0175
Sleeping...
Awake!
Sleeping...
Awake!
Sleeping...
Awake!
r = 3, mean = 0.99736, std. dev. = 0.0049723