linux 中 shell 记录程序运行时间
001、
[root@PC1 test]# start=`date +%s` ## 从 1970 年 1 月 1 日 00:00:00 UTC 到目前为止的秒数(时间戳) [root@PC1 test]# echo $start 1670412402 [root@PC1 test]# end=`date +%s` [root@PC1 test]# echo $end 1670412415 [root@PC1 test]# let time=$end-$start [root@PC1 test]# echo $time 13


浙公网安备 33010602011771号