差異處
這裏顯示兩個版本的差異處。
linux:shell_script:execution_time_measurement [2016/07/02 11:07] tony |
linux:shell_script:execution_time_measurement [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 測量執行時間 ====== | ||
- | ===== time command ===== | ||
- | 如果你的對象是一個command或execution file,只要直接使用time就可達成: | ||
- | <code bash> | ||
- | time ./test.sh > /dev/null | ||
- | </code> | ||
- | output: | ||
- | <code bash> | ||
- | real 0m0.020s | ||
- | user 0m0.009s | ||
- | sys 0m0.020s | ||
- | </code> | ||
- | ===== $SECONDS variable ===== | ||
- | ===== ===== | ||
- | ---- | ||
- | \\ | ||
- | ~~DISQUS~~ |