[issue19738] pytime.c loses precision under Windows

2015-04-09 Thread R. David Murray
R. David Murray added the comment: Victor, is this issue still relevant given your recent work on time? -- nosy: +r.david.murray ___ Python tracker ___ __

[issue19738] pytime.c loses precision under Windows

2013-11-23 Thread STINNER Victor
STINNER Victor added the comment: > I think the best choice would be a decimal object--which, now that we have > decimal in C, is probably sufficiently performant for serious consideration. This idea was rejected: see the PEP 410 :-) -- ___ Python t

[issue19738] pytime.c loses precision under Windows

2013-11-23 Thread Larry Hastings
Larry Hastings added the comment: Martin: I think the best choice would be a decimal object--which, now that we have decimal in C, is probably sufficiently performant for serious consideration. -- nosy: +larry ___ Python tracker

[issue19738] pytime.c loses precision under Windows

2013-11-23 Thread Tim Peters
Tim Peters added the comment: I agree overall with Martin, although time.time() could be made a little better on Windows by getting the Windows time directly (instead of "needlessly" losing info by going thru pygettimeofday). -- ___ Python tracker

[issue19738] pytime.c loses precision under Windows

2013-11-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think this issue can be resolved by reducing the loss to the maximum available precision; it's about time.time(), after all. I don't think pygettimeofday can change; gettimeofday traditionally has only µs. So the issue really is that it is used in implement

[issue19738] pytime.c loses precision under Windows

2013-11-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps we need a time_ns() method? (returning an integer timestamp in nanoseconds) -- ___ Python tracker ___ _

[issue19738] pytime.c loses precision under Windows

2013-11-23 Thread Tim Peters
Tim Peters added the comment: Just noting for the record that a C double (time.time() result) isn't quite enough to hold a full-precision Windows time regardless: >>> from datetime import date >>> d = date.today() - date(1970, 1, 1) >>> s = int(d.total_seconds()) # seconds into "the epoch" >>>

[issue19738] pytime.c loses precision under Windows

2013-11-23 Thread Antoine Pitrou
New submission from Antoine Pitrou: Under Windows, GetSystemTimeAsFileTime has a 100 ns resolution, but pygettimeofday stores it in a timeval which only has microsecond resolution. As a consequence, some precision is lost under Windows (which shows e.g. in time.time() results). -- com