[CentOS] time foo

Fri Dec 1 17:01:18 UTC 2017
Stephen John Smoogen <smooge at gmail.com>

On 1 December 2017 at 11:49, hw <hw at gc-24.de> wrote:
>
> Hi,
>
> isn´t this weird:
>
>
> # time foo
> real    43m39.841s
> user    15m31.109s
> sys     0m44.136s
>

This is counting the CPU time that a process used. If something is not
in 'CPU' but waiting on input etc it might not get counted in user or
sys. There is also the fact that the builtin bash time command you
used calculates things differently from the /usr/bin/time command.

>From the /usr/bin/time man page
        Note: some shells (e.g., bash(1)) have a  built-in  time  command  that
       provides less functionality than the command described here.  To access
       the real command, you may need to specify its pathname (something  like
       /usr/bin/time).

>From the bash man page
       When the shell is in posix mode, time may be followed by a newline.  In
       this case, the shell displays the total user and system  time  consumed
       by  the shell and its children.  The TIMEFORMAT variable may be used to
       specify the format of the time information.

The built in time is actually meant to be used with measuring pipeline
information but can be used by itself


>
> Almost 30 minutes have disappeared, but it actually took about that long,
> so what happened?
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos



-- 
Stephen J Smoogen.