[Python-checkins] r46146 - sandbox/trunk/rjsh-pybench/pybench.py

M.-A. Lemburg mal at egenix.com
Thu May 25 17:22:10 CEST 2006


Martin v. Löwis wrote:
> M.-A. Lemburg wrote:
>> I did the next best thing:
>>
>> win32process.GetProcessTimes(win32process.GetCurrentProcess())
>>
>> Looking at the win32 docs, the GetCurrentProcess() returns an
>> int where GetProcessTimes() wants a PyHANDLE.
>>
>> Shouldn't have known better though to actually *look* at
>> the return value of GetCurrentProcess():
>>
>> -1
>>
>> Looks like I should have used OpenProcess() instead.
> 
> See
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getcurrentprocess.asp
> 
> The process handle -1 *does* denote the current process; you
> don't need to open your own process.

Hmm, then I don't understand why I get weird results from the
GetProcessTimes() API.

I'll have to do some more testing.

It's possible that the Windows API has a different understanding
of what "user time" refers to than e.g. Linux does.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, May 25 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-checkins mailing list