Created
May 3, 2023 00:48
-
-
Save dantsec/5815e539a70cc788080bf592436523e8 to your computer and use it in GitHub Desktop.
Simple Cronometer made in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
hours = minutes = seconds = 0 | |
try: | |
while(True): | |
if(seconds == 60): | |
seconds = 0 | |
minutes += 1 | |
if(minutes == 60): | |
minutes = 0 | |
hours += 1 | |
seconds += 1 | |
sleep(1) | |
print(f"\t{hours} : {minutes} : {seconds}") | |
except KeyboardInterrupt: | |
exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment