[New-bugs-announce] [issue13845] Use GetSystemTimeAsFileTime() to get a resolution of 100 ns on Windows

STINNER Victor report at bugs.python.org
Tue Jan 24 01:02:45 CET 2012


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

Python implements time.time() using gettimeofday() which has only a resolution of 1 microsecond because it uses the timeval structure which is only able to store microseconds.

Attached patch changes _PyTime_gettimeofday() to make it uses the timespec structure (which has a resolution has 1 nanosecond) and use GetSystemTimeAsFileTime() on Windows. So time.time() has a theorical resolution 10 times better than currently.

----------
files: timespec.patch
keywords: patch
messages: 151865
nosy: belopolsky, haypo
priority: normal
severity: normal
status: open
title: Use GetSystemTimeAsFileTime() to get a resolution of 100 ns on Windows
versions: Python 3.3
Added file: http://bugs.python.org/file24305/timespec.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13845>
_______________________________________


More information about the New-bugs-announce mailing list