import time as t
class MyTimer():
def __init__(self):
self.unit=['年','月','日','时','分','秒']
self.borrow = [0, 12, 31, 24, 60, 60]
self.prompt='未开始计时'
self.lasted=[]
self.begin=0
self.end=0
def __str__(self):
return self.prompt
__repr__=__str__
def __add__(self, other):
prompt='总共运行了:'
result=[]
python练习题,计算运行时间
最新推荐文章于 2022-11-21 17:13:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)