How to set a timer in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to set a timer in python?

Hi I am a beginner at python and I would like to make a game that has time awnser some questions but I have no ideia how to make a timer that after three seconds print "game over" message.

25th Jun 2019, 7:16 PM
Duarte Gonçalves
Duarte Gonçalves - avatar
4 Answers
+ 8
You can try one of these functions. First is for Unix and second is for Windows. I couldn't test second but first worked for me. https://code.sololearn.com/cs224QKjQoP3/?ref=app
25th Jun 2019, 7:46 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 4
Are you making a console game or using a module like pygame
25th Jun 2019, 7:22 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 1
Ok thank you I'll test the windows version on my windows machine and I'll see the other in a vm
25th Jun 2019, 9:45 PM
Duarte Gonçalves
Duarte Gonçalves - avatar
0
Console game
25th Jun 2019, 7:23 PM
Duarte Gonçalves
Duarte Gonçalves - avatar