小编NPE*_*ion的帖子

为什么 time.time() - time.time() = 0.0?

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import time
>>> time.time() - time.time()
0.0
Run Code Online (Sandbox Code Playgroud)

为什么会这样?根据我的简单理解,此函数返回自调用的确切时间的纪元以来以秒为单位的系统时钟。但是两次调用 time.time() 不应该返回稍微不同的浮点数吗?

python time python-3.x

2
推荐指数
1
解决办法
2320
查看次数

标签 统计

python ×1

python-3.x ×1

time ×1