【发布时间】:2010-12-26 16:46:03
【问题描述】:
如何计算毫秒,从下面的代码。
a = datetime.datetime.now()
b = datetime.datetime.now()
c = b - a
>>> c
>>> c.days
0
>>> c.seconds
4
>>> c.microseconds
【问题讨论】:
如何计算毫秒,从下面的代码。
a = datetime.datetime.now()
b = datetime.datetime.now()
c = b - a
>>> c
>>> c.days
0
>>> c.seconds
4
>>> c.microseconds
【问题讨论】:
milliseconds = (c.days * 24 * 60 * 60 + c.seconds) * 1000 + c.microseconds / 1000.0
【讨论】:
【讨论】: