New issue 1956: clock() has odd timing https://bitbucket.org/pypy/pypy/issue/1956/clock-has-odd-timing
Claire Charron: cross-post from Stack Overflow: https://stackoverflow.com/questions/27829225/why-is-pypys-clock-so-imprecise See the following code: ``` from time import clock from random import randint times = [] for _ in range(10): start = clock() sum(i * i for i in range(randint(1000000, 2000000))) # waste time end = clock() times.append(int((end - start) * 1000000)) for t in times: print(t, "µs") ``` If you run it, you'll notice that clock() is only accurate to about 1/30th of a second. This isn't sufficient for any kind of timing. _______________________________________________ pypy-issue mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-issue
