About 1,230,000 results
Open links in new tab
  1. python - How to use the timeit module? - Stack Overflow

    How do I use timeit to compare the performance of my own functions such as insertion_sort and tim_sort?

  2. ipython - What is %timeit in Python? - Stack Overflow

    Mar 26, 2015 · %timeit is an IPython magic function, which can be used to time a particular piece of code (a single execution statement, or a single method). From the documentation: %timeit …

  3. python - How to use timeit when timing a function - Stack Overflow

    Sep 25, 2013 · You can read how to use timeit here. And assuming you have a function called performSearch in the same file that your running timeit from the following would work.

  4. python - time.time vs. timeit.timeit - Stack Overflow

    it disables the garbage collector to prevent that process from skewing the results by scheduling a collection run at an inopportune moment. it picks the most accurate timer for your OS, …

  5. How can I time a code segment for testing performance with …

    Rather than select a clock by hand, use timeit.default_timer; Python has already done the work for you. But really, you should use timeit.timeit(myfast, number=n) instead of re-inventing the …

  6. How do I measure elapsed time in Python? - Stack Overflow

    The python cProfile and pstats modules offer great support for measuring time elapsed in certain functions without having to add any code around the existing functions.

  7. How to use python timeit when passing variables to functions?

    How to use python timeit when passing variables to functions? Asked 14 years, 3 months ago Modified 6 years, 11 months ago Viewed 50k times

  8. python - IPython %timeit what is loop and iteration in the options ...

    Sep 5, 2017 · IPython %timeit what is loop and iteration in the options? Asked 8 years, 4 months ago Modified 5 years, 7 months ago Viewed 23k times

  9. python - timeit versus timing decorator - Stack Overflow

    64 msec per loop % python - m timeit - s 'from itertools import izip' 'alist=range(1000000);i=iter(alist);[x for x in izip(*[i]*31)]' 10 loops, best of 3: 66.5 msec per …

  10. Timing a single block in Jupyter with one line of code

    Jul 3, 2017 · Use the cell magic %%timeit (with two %) to time a whole jupyter cell, instead of just a single line. The cell magic must come before any python code in the cell.