Message203943
os.utime() uses the following code when times is None under Windows:
SYSTEMTIME now;
GetSystemTime(&now);
if (!SystemTimeToFileTime(&now, &mtime) ||
!SystemTimeToFileTime(&now, &atime)) {
PyErr_SetFromWindowsErr(0);
goto exit;
}
The problem is GetSystemTime has poor resolution (milliseconds). Instead, it could call GetSystemTimeAsFileTime which writes directly into a FILETIME structure, and potentially (?) has better resolution.
(according to a comment on MSDN, "Resolution on Windows 7 seems to be sub-millisecond": http://msdn.microsoft.com/en-us/library/windows/desktop/ms724397%28v=vs.85%29.aspx ) |
|
Date |
User |
Action |
Args |
2013-11-23 01:15:52 | pitrou | set | recipients:
+ pitrou, tim.peters, loewis, larry, tim.golden, brian.curtin, steve.dower |
2013-11-23 01:15:52 | pitrou | set | messageid: <1385169352.32.0.642692439706.issue19727@psf.upfronthosting.co.za> |
2013-11-23 01:15:52 | pitrou | link | issue19727 messages |
2013-11-23 01:15:50 | pitrou | create | |
|