[Python-Dev] GIL behaviour under Windows (original) (raw)
John Arbash Meinel john at arbash-meinel.com
Wed Oct 21 20:00:54 CEST 2009
- Previous message: [Python-Dev] GIL behaviour under Windows
- Next message: [Python-Dev] time.clock() on windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Antoine Pitrou wrote:
Le mercredi 21 octobre 2009 à 12:42 -0500, John Arbash Meinel a écrit :
You can use time.clock() instead to get <15ms resolution. Changing all instances of 'time.time' to 'time.clock' gives me this result: [snip] --- Latency ---
Background CPU task: Pi calculation (Python) CPU threads=0: 24727 ms. (std dev: 0 ms.) CPU threads=1: 27930 ms. (std dev: 0 ms.) CPU threads=2: 31029 ms. (std dev: 0 ms.) CPU threads=3: 34170 ms. (std dev: 0 ms.) CPU threads=4: 37292 ms. (std dev: 0 ms.) Well apparently time.clock() has a per-process time reference, which makes it unusable for this benchmark :-( (the numbers above are obviously incorrect) Regards Antoine.
I believe that 'time.count()' is measured as seconds since the start of the process. So yeah, I think spawning a background process will reset this counter back to 0.
John =:->
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkrfTFYACgkQJdeBCYSNAAObWQCfRJsRENbcp6kuo2x1k+HvhYGZ ftsAn2PNnNHNj6D4esNBMhlSdH4IjeMA =1KWG -----END PGP SIGNATURE-----
- Previous message: [Python-Dev] GIL behaviour under Windows
- Next message: [Python-Dev] time.clock() on windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]