Vertical Sync sensor: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 116: Line 116:
rect.draw()
rect.draw()
win.flip()
win.flip()
tok = time.perf_counter()
tik = time.perf_counter()
# wait for a sync square
# wait for a sync square
b = ser.read()
b = ser.read()
tik = time.perf_counter()
tok = time.perf_counter()
# show delay after a flip
# show delay after a flip
print("your timing after a flip: {}s".format(tik-tok))
print("your timing after a flip: {}s".format(tok-tik))
# as a remark 60Hz/~0.016s 120Hz/~0.008s
# as a remark 60Hz/~0.016s 120Hz/~0.008s