Question

I would like to know if /usr/bin/time supports more precisions digits than 2? i.e. when I run:

/usr/bin/time -f %U ls

it gives me : 0.00, is there any way to increase the digits ?

Secondly, although time refers to /usr/bin/time in my system, but their outputs are different, why is that ? i.e.

/usr/bin/time -f %U ls
0.00user 0.00system 0:00.03elapsed 23%CPU (0avgtext+0avgdata 3104maxresident)k
0inputs+0outputs (0major+259minor)pagefaults 0swaps

BUT

$time ls
real    0m0.023s
user    0m0.008s
sys     0m0.008s

while I have:

$which time
/usr/bin/time
Was it helpful?

Solution

There is unfortunately no chance to increase the precision. Sorry for the short answer, but I will say a few words to the second question.

While you have the program time installed at /usr/bin/time (which shows this), there is also a bash builtin with the same name. bash will use a builtin in favour of a binary unless you specify the whole path to the binary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top