All pastes #545792 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-06 21:30 UTC
rendered paste body
stmt = """
def testit():
    i = 0
    d = {}
    while i < %(max)d:
        d[i] = i
        i = i + 1
    for k in d.keys():
        print k, "\r",
    print ""
"""

if __name__ == '__main__':
    from timeit import Timer
    for i in (1000, 1000000, 1000000000):
        print "timed with", i, "repetitions:"
        t = Timer(stmt % {'max': i})
        print t.timeit()