mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-14 19:36:38 +03:00
longer benchmark
This commit is contained in:
parent
594276c45e
commit
4cacfe6b11
|
@ -19,10 +19,16 @@ def iterate_set(size, access):
|
||||||
access[(x,y)] = access[(x,y)]
|
access[(x,y)] = access[(x,y)]
|
||||||
|
|
||||||
def timer(func, label, *args):
|
def timer(func, label, *args):
|
||||||
|
iterations = 1000
|
||||||
starttime = time.time()
|
starttime = time.time()
|
||||||
func(*args)
|
for x in range(iterations):
|
||||||
endtime = time.time()
|
func(*args)
|
||||||
print ("%s: %.4f s" %(label, endtime-starttime))
|
if time.time()-starttime > 10:
|
||||||
|
print ("%s: breaking at %s iterations, %.6f per iteration"%(label, x+1, (time.time()-starttime)/(x+1.0)))
|
||||||
|
break
|
||||||
|
if x == iterations-1:
|
||||||
|
endtime = time.time()
|
||||||
|
print ("%s: %.4f s %.6f per iteration" %(label, endtime-starttime, (endtime-starttime)/(x+1.0)))
|
||||||
|
|
||||||
def test_direct():
|
def test_direct():
|
||||||
im = lena()
|
im = lena()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user