差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改
前次修改
linux:shell_script:execution_time_measurement [2016/07/02 17:06]
tony [date command]
linux:shell_script:execution_time_measurement [2023/06/25 09:48] (目前版本)
行 1: 行 1:
 +{{tag>​Linux ShellScript}}
 ====== 測量執行時間 ====== ====== 測量執行時間 ======
 ===== time command ===== ===== time command =====
行 24: 行 25:
 </​code>​ </​code>​
 ===== date command ===== ===== date command =====
-透過date指令可以取得到nano second(10^-9)的差距+與$SECONDS方法類似,但可以精確到nano second(10^-9)的差距:
 <code bash> <code bash>
 START=`date +%s%N` START=`date +%s%N`
 echo $START echo $START
  
 +# some operations
 sleep 1 sleep 1