classification
Title: os.times() utime and stime exchanged on windows
Type: behavior Stage:
Components: Extension Modules, Windows Versions: Python 3.0, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: amaury.forgeotdarc, christian.heimes, facundobatista, georg.brandl, kcwu
Priority: high Keywords: patch

Created on 2008-02-11 07:41 by kcwu, last changed 2008-02-13 07:20 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
diff-win-os-times.txt kcwu, 2008-02-11 07:41 patch for trunk
Messages (4)
msg62274 - (view) Author: Kuang-che Wu (kcwu) Date: 2008-02-11 07:41
According to document, os.times()[0] is process user time, [1] is system
time. However this two value was implemented exchanged on windows.

Python all versions have this issue. Attached patch is for trunk.
msg62313 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-02-12 12:49
How can we test it? What can we do to "see" it?
msg62316 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-02-12 13:14
As a suggestion, we could just run some computation that does no system
call:

>>> import os
>>> os.times()
(0.015625, 0.015625, 0.0, 0.0, 0.0)
>>> max(xrange(10000000))   # this takes half a second on my machine
9999999
>>> os.times()
(0.015625, 0.484375, 0.0, 0.0, 0.0)

utime delta should be much higher than stime delta. This is obviously
not the case here; the values seems inverted.
   (os.times() -> (utime, stime, cutime, cstime, elapsed_time))
msg62352 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-02-13 07:20
Fixed on trunk in r60758. Should this be backported?
History
Date User Action Args
2008-02-13 07:20:34georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
messages: + msg62352
resolution: fixed
2008-02-12 13:14:49amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg62316
2008-02-12 12:49:55facundobatistasetnosy: + facundobatista
messages: + msg62313
2008-02-11 11:00:10christian.heimessetpriority: high
assignee: christian.heimes
keywords: + patch
nosy: + christian.heimes
2008-02-11 07:41:36kcwucreate