Help regarding python run time
Ian Kelly
ian.g.kelly at gmail.com
Wed May 20 12:26:55 EDT 2015
On Wed, May 20, 2015 at 9:48 AM, Irmen de Jong <irmen.NOSPAM at xs4all.nl> wrote:
> Or measure the actual CPU clock cycles taken instead of the wall clock run time.
> Then you should get a fairly constant number, if the program does the same work every
> time you run it.
>
> phobos:~ irmen$ time python test.py
> real 0m3.368s
> user 0m0.214s <--- cpu time spent in user mode actually doing work
> sys 0m0.053s
And yet:
$ time python3 primes.py
real 0m1.101s
user 0m1.099s
sys 0m0.000s
$ time python3 primes.py
real 0m1.135s
user 0m1.128s
sys 0m0.004s
$ time python3 primes.py
real 0m1.162s
user 0m1.147s
sys 0m0.013s
http://unix.stackexchange.com/questions/162115/why-does-the-user-and-sys-time-vary-on-multiple-executions
More information about the Python-list
mailing list