Python 时间(毫秒)计算

python time(milli seconds) calculation

从下面的代码计算毫秒。

1
2
3
4
5
6
7
8
9
10
11
a = datetime.datetime.now()
b = datetime.datetime.now()
c = b - a

>>> c

>>> c.days
0
>>> c.seconds
4
>>> c.microseconds


字母名称


(P)Or,New Since 2.7:(p)字母名称(P)(https://docs.python.org/2/library/datetime.html)(p)