How can I output the real time a command takes (and nothing else)?
Example:
This won't work:
$ time -p sleep 2 | grep real
real 2.00
user 0.00
sys 0.00
I want something like:
$ print-real-time sleep 2
2.00
|
How can I output the real time a command takes (and nothing else)? Example: This won't work:
I want something like:
|
|||
|
|
|
You need to capture the output of |
|||||||||||||
|
|
A non-BASH-specific solution (explicitly use
Depending on the delicate nature of whatever you feed this output to you may want to redirect the output of your subject command to /dev/null... |
||||
|
|
|
Here's a hacky solution using
You can also use
|
|||||||||
|