#!/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}”
如无特殊说明,文章均为本站原创,转载请注明出处
- 转载请注明来源:shell脚本执行时间统计
- 本文永久链接地址:http://www.hongxiaowei.com/xiaowei/772.html