Timeline for How to measure time of program execution and store that inside a variable
Current License: CC BY-SA 3.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 26, 2011 at 20:27 | comment | added | marinus |
@STATUS_ACCESS_DENIED: time does not merge its command's stdout and stderr. The way I showed assumed that you only needed the command's stdout output. Since bash will only store what comes out of stdout, you have to redirect. In case you can safely drop your command's stderr: the time will always be on the last line of stderr. If you do need both your command's output streams, I'd suggest wrapping it in another script.
|
|
| Apr 26, 2011 at 19:57 | comment | added | 0xC0000022L |
ooh, I didn't realize. I knew time writes to stderr, but I didn't realize that it would merge stdout and stderr of the executed command into its stdout. But generally there is no direct method (i.e. without intermediate file)? +1.
|
|
| Apr 26, 2011 at 19:43 | history | answered | marinus | CC BY-SA 3.0 |