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

 

posted @ 2022-12-07 19:29  小鲨鱼2018  阅读(633)  评论(0编辑  收藏  举报