记录脚本运行时间

#!/bin/bash 
start=$(date +%s) # 1528437613
ping -c 10 baidu.com &> /dev/null 
end=$(date +%s) 
difference=$(( end - start )) 
echo $difference seconds.

运行后会输出脚本的运行时间

[root@localhost ~]# bash test.sh 
10 seconds.

 

posted @   Chuyio  阅读(722)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示