8

BSD time gives this kind of output

9990

real    0m4.371s
user    0m1.548s
sys 0m2.167s

GNU time gives then again this kind of output

9990
1.56s user 1.46s system 82% cpu 3.648 total

Brew search gtime gives nothing. GNU time is probably in some C library, however, I am not sure which. There is no apparent package for it.

How can you install GNU time in OSX?

  • 1
    Using /usr/bin/time gives me the results that you want. time by itself with a command is a shell keyword. – fd0 Jul 1 '15 at 20:40
  • 1
    @fd0 I do not get such an output. My time is also in usr/bin/time. My time version is BSD 1993. You must have different version of time. – Léo Léopold Hertz 준영 Jul 1 '15 at 20:44
  • time date vs /usr/bin/time date produce 2 different outputs (like your examples above). But which time gives /usr/bin/time. – CousinCocaine Jul 1 '15 at 20:51
  • brew install gnu-time – CousinCocaine Jul 1 '15 at 20:54
  • @Masi the time man page states BSD June 6, 1993. I have no idea why your results are different. – fd0 Jul 1 '15 at 21:11
15

I think what you are looking for is available as...

brew install gnu-time

Which you can then call as...

gtime ...

| improve this answer | |
  • 1
    you just beat me to it. gist.github.com/gregelin/9529716 – CousinCocaine Jul 1 '15 at 20:54
  • No manuals installed by this in gtime. How can you get manuals also with this command? I would like to get more significant numbers in timing. – Léo Léopold Hertz 준영 Jul 6 '15 at 8:39
  • 2
    The original package from GNU doesn't appear to have a man page. However it does have an info file you can find with info time. – Alistair McMillan Jul 7 '15 at 7:38
  • 1
    @LéoLéopoldHertz준영 here's an online version of the man page – Dennis Feb 3 '17 at 17:53
  • 2
    If you want to call it as time, then install it as brew install gnu-time --with-default-names. Your original installation of bsd-time will still exist, but gnu-time will be executed by default as it appears in your PATH first. – Dennis Feb 3 '17 at 17:57
1

GNU time is available in homebrew in package gnu-time.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .