shell脚本执行时间统计

#!/bin/bash

begin_time=$(date “+%s”)
echo -e “begin_time = $begin_time”
sleep 3
make
end_time=$(date “+%s”)
echo -e “end_time = $end_time”

time_distance=$(($end_time – $begin_time));
hour_distance=$(expr ${time_distance} / 3600)
hour_remainder=$(expr ${time_distance} % 3600)
min_distance=$(expr ${hour_remainder} / 60)
min_remainder=$(expr ${hour_remainder} % 60)
echo -e “spend time is ${hour_distance}:${min_distance}:${min_remainder}”

1
如无特殊说明,文章均为本站原创,转载请注明出处

该文章由 发布

这货来去如风,什么鬼都没留下!!!