Skip to content

Instantly share code, notes, and snippets.

@bwindsor
Created February 15, 2024 12:08
Show Gist options
  • Save bwindsor/a5313d0591a136cc141f8fe6abd394d2 to your computer and use it in GitHub Desktop.
Save bwindsor/a5313d0591a136cc141f8fe6abd394d2 to your computer and use it in GitHub Desktop.
Function to time you typing the alphabet
def time_alphabet():
print("Time starts when you press a. Time will be printed when you finish by pressing z. If you go wrong, it won't tell you and your time won't stop. Press 0 to quit in this case.")
a1 = msvcrt.getch()
if a1 == b'a':
t0 = time.monotonic()
u = b''
while u != b'bcdefghijklmnopqrstuvwxyz':
c = msvcrt.getch()
u += c
if c == b'0':
return
t1 = time.monotonic()
print(t1-t0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment