result of os.times() is different with 'time' command Options
timr at probo.com
Mon Mar 15 03:14:56 CET 2010
hiral <hiralsmaillist at gmail.com> wrote:
>$ time ls
>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, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-list