News for hackers. Stuff that matters.
Re:/usr/bin/time: not the command you think you know by fnord123 on Tuesday March 07, 2017 @05:09AM (#13809386)
This also gives the time of the entire pipeline (since the commands all begin together and only finish when the last command has completed):

echo | /usr/bin/time sleep 1

Re:/usr/bin/time: not the command you think you know by roblabla on Tuesday March 07, 2017 @07:31AM (#13809850)
I'm pretty sure this is wrong.

As an example :

sleep 2 | /usr/bin/time sleep 1

This gives an output of "1 second" even though the entire pipeline took 2 seconds.

Re:/usr/bin/time: not the command you think you know by fnord123 on Tuesday March 07, 2017 @08:15AM (#13810037)
Ok you can wangle your way out of it. But if you're doing something like `grep "$something" | /usr/bin/time some_job` then generally you're fine.
Re:/usr/bin/time: not the command you think you know by perennate on Tuesday March 07, 2017 @08:46AM (#13810227)
Wouldn't the system/user time be wrong though?
Re:/usr/bin/time: not the command you think you know by exprA on Tuesday March 07, 2017 @08:06AM (#13809997)
The sleep sub-process of time is not part of the pipeline, however. It will exit after the requested time has passed.