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

    Nov 22, 2011 · 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 Time …

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

    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 repetitive call …

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

    Sep 25, 2013 · 16 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.

  5. 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, 5 months ago Modified 5 years, 8 months ago Viewed 23k times

  6. 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 loop Using timeit the results are virtually the …

  7. 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.

  8. 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, time.time or …

  9. python - Using timeit module in a function with arguments - Stack …

    Using timeit module in a function with arguments Asked 12 years, 8 months ago Modified 11 years, 9 months ago Viewed 8k times

  10. python 3.x - timeit.timeit VS timeit.Timer.repeat - What is the best ...

    May 7, 2019 · 0 timeit.timeit () is better suited for measuring the execution time of a single statement or function, while timeit.repeat () is better suited for measuring the execution time of a larger chunk of …