On Mar 15, 7:14 am, Tim Roberts <t...@probo.com> wrote: > hiral<hiralsmaill...@gmail.com> wrote: > >... > >Output: > >real 0.0m0.0100000002421s > >user 0.0m0.0s > >sys 0.0m0.0s > > >Command: > >$ time ls > > >Output: > >real 0m0.007s > >user 0m0.000s > >sys 0m0.000s > > >Is this the intended behaviour? > > What is it that you are wondering about? The formatting difference is due > to your code. The difference between 10 milliseconds and 7 milliseconds > could be due to any number of things. First, you have the overhead of > Python involved in your measurements. Second, you have the variability of > memory caching and disk caching. Your Python code causes /bin/ls to be > loaded into memory, and it's probably still in a file cache when you run > the second command. > > You can't really do an analysis like this with a task that only takes a few > milliseconds. There are too many variables. > -- > Tim Roberts, t...@probo.com > Providenza & Boekelheide, Inc.- Hide quoted text - > > - Show quoted text -
Thanks for your explanation. -- http://mail.python.org/mailman/listinfo/python-list