From: 7stud <7s...@ex...> - 2012-02-15 03:23:28
|
Benjamin Root <ben.root@...> writes: > > The second one shouldn't take much time at all to finish. > How long did it take? How big was the png file? > Ben Root def my_func(): import matplotlib.pyplot as plot xs = [2, 3, 5, 7, 11] ys = [4, 9, 5, 9, 1] plot.plot(xs, ys) plot.savefig("squaremod10.png") import timeit t = timeit.Timer('my_func()', 'from __main__ import my_func') print(t.timeit(100) / 100) $ python mpl1.py 0.14541503191 $ ls -al squaremod10.png -rw-r--r-- 1 7stud staff 27904 Feb 14 20:12 squaremod10.png |