[Numpy-discussion] extracting a random subset of a vector
Robert Kern
rkern at ucsd.edu
Tue Sep 7 16:38:16 EDT 2004
[Replying to the list instead of just Jp. Sorry, Jp! Mail readers will
be the death of me.]
Jp Calderone wrote:
> Chris Barker wrote:
>
>> Curzio Basso wrote:
>>
>>> a question about the method: isn't a bit risky to use the clock() for
>>> timing the performance? The usual argument is that CPU allocates time
>>> for different processes, and the allocation could vary.
>>
>>
>>
>> that's why I use time.clock() rather than time.time().
>>
>
> Perhaps clearing up a mutually divergent assumption: time.clock()
> measures CPU time on POSIX and wallclock time (with higher precision
> than time.time()) on Win32.
FWIW, the idiom recommended by Tim Peters is the following:
import time
import sys
if sys.platform == 'win32':
now = time.clock
else:
now = time.time
and then using now() to get the current time.
> Jp
--
Robert Kern
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the NumPy-Discussion
mailing list