20 February 2022

In a previous post I described time command, in this post I will show another usefull command that could be used to prints the accumulated user and system times for the shell and all of its child processes.

Note: all example below could be execute in a container:

docker run -it  ubuntu /bin/bash

In this example is execute times before and after a sleep command.

times && sleep 2 && times
0m0.067s 0m0.054s
0m0.013s 0m0.013s
0m0.067s 0m0.054s
0m0.013s 0m0.015s

The accumulated user and system times are:

0m0.067s 0m0.054s
0m0.013s 0m0.013s
0m0.067s 0m0.054s
0m0.013s 0m0.015s

What is changed is accumulated system times because the system run a sleep of two seconds. As we can see accumulated user times it is not changed because the execution in CPU/time utilization is very fast, under the 0.00s.

References