参考:https://www.cnblogs.com/leixingzhi7/p/6281675.html

starttime=`date +'%Y-%m-%d %H:%M:%S'`
#执行程序
endtime=`date +'%Y-%m-%d %H:%M:%S'`
start_seconds=$(date --date="$starttime" +%s);
end_seconds=$(date --date="$endtime" +%s);
echo "本次运行时间: "$((end_seconds-start_seconds))"s"

相关文章:

  • 2021-12-09
  • 2022-02-27
  • 2021-12-09
  • 2021-06-08
  • 2021-06-14
  • 2022-02-04
猜你喜欢
  • 2022-02-09
  • 2021-12-28
  • 2022-12-23
  • 2021-12-19
  • 2021-06-10
  • 2021-05-28
相关资源
相似解决方案