如果我错了,请纠正我,但我认为您也可以使用以下方法:
而不是
if elapsed > datetime.timedelta(seconds=1):
你可以说
if elapsed.seconds > 1: