Vincent Michel <vxgmic...@gmail.com> added the comment:

I thought about it a bit more and I realized there is no way to recover the 
time in hundreds of nanoseconds from the float produced by `time.time()` (since 
the windows time currently takes 54 bits and will take 55 bits in 2028). 

That means `time()` and `time_ns()` cannot be compared by converting time() to 
nanoseconds, but it might still make sense to compare them by converting 
time_ns() to seconds (which is apparently broken at the moment).

If that makes sense, a possible roadmap to tackle this problem would be:
- fix `_PyTime_AsSecondsDouble` so that `time.time_ns() / 10**9 == time.time()`
- add a warning in the documentation that one should be careful when comparing 
the timestamps produced by `time()` and time_ns()` (in particular, `time()` 
should not be converted to nanoseconds)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39484>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to