如何创建一个在按下回车键时启动和停止的计时器。 [英] How do I create a timer that will start and stop when the enter key is pressed.
本文介绍了如何创建一个在按下回车键时启动和停止的计时器。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须制作一个游戏,看看有多好的人在猜测时间已经过了10秒,在Python中但是我不知道如何创建一个计时器。
任何帮助都会很多赞赏。谢谢
我尝试了什么:
我没有去过成功找到了对我有用的东西。
I have to make a game for seeing how good people are at guessing when 10 seconds have elapsed, in Python but I'm not sure how to create a timer.
any help will be much appreciated. Thanks
What I have tried:
I haven't been successful at finding anything that would help me.
推荐答案
致电时间 [ ^ ]方法两次(每次按下回车键,然后减去这些值以获得经过的时间间隔。
Call the time[^] method twice (each time the enter key is pressed) and then subtract the values to get the elapsed interval.
这篇关于如何创建一个在按下回车键时启动和停止的计时器。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文