Ai
1 Star 0 Fork 0

dzc/Python-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SimpleStopWatch.py 650 Bytes
一键复制 编辑 原始数据 按行查看 历史
Praneeth Reddy 提交于 2018-11-04 09:41 +08:00 . Update SimpleStopWatch.py
#Author: OMKAR PATHAK
#This script helps to build a simple stopwatch application using Python's time module.
import time
print('Press ENTER to begin, Press Ctrl + C to stop')
while True:
try:
input() # For ENTER. Use raw_input() if you are running python 2.x instead of input()
starttime = time.time()
print('Started')
while True:
print('Time Elapsed: ', round(time.time() - starttime, 0), 'secs', end="\r")
time.sleep(1)
except KeyboardInterrupt:
print('Stopped')
endtime = time.time()
print('Total Time:', round(endtime - starttime, 2),'secs')
break
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sdredboy/Python-1.git
git@gitee.com:sdredboy/Python-1.git
sdredboy
Python-1
Python-1
master

搜索帮助