Calculates the number of operations you calculator can compute
from kandinsky import * from time import * def ops(): M=[[],[]] draw_string("With graphical",90,0) a=0 for i in range(10): b,c=monotonic(),a while monotonic()-b<1:a+=1;draw_string(str(a),0,20) d=a-c draw_string(str(d)+"/s",0,40) M[0].append(d) draw_string("Without graphical",75,0) fill_rect(0,20,320,40,(0,0,0)) a=0 for i in range(10): b,c=monotonic(),a while monotonic()-b<1:a+=1 d=a-c draw_string(str(d)+"/s",0,40) M[1].append(d) draw_string("ok",150,101) print("av.graphical:"+str(sum(M[0])/10)) print("av.onlycompute:"+str(sum(M[1])/10)) ops()