Afficher un message
Vieux 29/04/2008, 15h50   #17
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: commands to manipulate files

2008-04-29, 06:38(-07), Janis:
> On 29 Apr., 15:19, Stephane CHAZELAS <this.addr...@is.invalid> wrote:
>> 2008-04-29, 05:35(-07), mop2:
>> > real 0m0.001s
>> > user 0m0.004s
>> > sys 0m0.000s

>>
>> Note that the above shows either that those timings cannot be
>> trusted or that the awk solution uses less CPU time (0ms!) than
>> the shell-only solution (4ms)!

>
> In the past decades I've always thought (and haven't ever observed
> it differently) that the 'real' value is at least as large as
> max('user','sys') or differs at best only in the least significant
> digit if comparing it to 'user'+'sys'. And the man pages seem to
> confirm that view. How can 'real' be 1ms if 'user' is around 4ms?

[...]

"real" is <end-time> - <start-time>, which on a system running
more than one process and one or several CPU has little
correlation with the number of CPU cycles that are needed to
execute the corresponding code. You have to consider the time
used up by other processes, the time waiting for resources, and
the fact that several processors might run concurrently to
perform the task.

All you are guaranteed is that:

real >= (user + sys) / ncpus

--
Stéphane
  Réponse avec citation
 
Page generated in 0,07376 seconds with 9 queries