homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients benjamin.peterson, gregory.p.smith, koobs, mcjeff, r.david.murray, vstinner
Date 2015年04月24日.22:37:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429915041.21.0.427402181449.issue23863@psf.upfronthosting.co.za>
In-reply-to
Content
> We don't have the same definition of the unit "seconds" :-)
Or, please forget my comment, I watched the first 4 items of os.times(). I didn't notice the difference of the 5th item, os.times()[4].
The bad news is that only the first two items of os.times() are filled on Windows :-( I don't think that Python 2.7 provides a monotonic clock on Windows.
static PyObject *
os_times_impl(PyModuleDef *module)
{
#ifdef MS_WINDOWS
 FILETIME create, exit, kernel, user;
 HANDLE hProc;
 hProc = GetCurrentProcess();
 GetProcessTimes(hProc, &create, &exit, &kernel, &user);
 /* The fields of a FILETIME structure are the hi and lo part
 of a 64-bit value expressed in 100 nanosecond units.
 1e7 is one second in such units; 1e-7 the inverse.
 429.4967296 is 2**32 / 1e7 or 2**32 * 1e-7.
 */
 return build_times_result(
 (double)(user.dwHighDateTime*429.4967296 +
 user.dwLowDateTime*1e-7),
 (double)(kernel.dwHighDateTime*429.4967296 +
 kernel.dwLowDateTime*1e-7),
 (double)0,
 (double)0,
 (double)0);
...
History
Date User Action Args
2015年04月24日 22:37:21vstinnersetrecipients: + vstinner, gregory.p.smith, benjamin.peterson, r.david.murray, mcjeff, koobs
2015年04月24日 22:37:21vstinnersetmessageid: <1429915041.21.0.427402181449.issue23863@psf.upfronthosting.co.za>
2015年04月24日 22:37:21vstinnerlinkissue23863 messages
2015年04月24日 22:37:20vstinnercreate

AltStyle によって変換されたページ (->オリジナル) /