Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #90966

Re: Help regarding python run time

References <CALbtgctWb5zHWG=Nf-Qoi94gUscp3L=Xx39a_onqzzx1hNci6A@mail.gmail.com> <mailman.172.1432135454.17265.python-list@python.org> <555cacd9$0$2934$e4fe514c@news2.news.xs4all.nl>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2015-05-20 10:26 -0600
Subject Re: Help regarding python run time
Newsgroups comp.lang.python
Message-ID <mailman.176.1432139258.17265.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, May 20, 2015 at 9:48 AM, Irmen de Jong <irmen.NOSPAM@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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Help regarding python run time Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-20 09:23 -0600
  Re: Help regarding python run time Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-05-20 17:48 +0200
    Re: Help regarding python run time Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-20 10:26 -0600

csiph-web