我有两次以下格式。我想以毫秒为单位找到时间差。这仅提供秒精度。如何使这项工作持续几毫秒?谢谢。蟒蛇新手。
import time
t1 = "2013-09-13 15:43:35,893"
t2 = "2013-09-13 15:43:45,147"
TIME_FORMAT2 = "%Y-%m-%d %H:%M:%S,%f"
t11 = time.mktime(time.strptime(t1, TIME_FORMAT2))
t12 = time.mktime(time.strptime(t2, TIME_FORMAT2))
print t11-t12