import time as t
class Mytimer():
def init(self):
self.begin=0
self.end=0
self.prompt="未开始计时"
self.lasted= []
def str(self):
return self.prompt
repr =__str__
def start(self):
self.begin=t.localtime
print("计时开始")
def stop(self):
self.end=t.localtime
print("计时结束")
self.calc()
def calc(self):
self.lasted=[]
for index in range(6):
self.lasted.insert(self.end[index] - self.begin[index])
self.prompt+=str(self.lasted[index])