Linux 计算shell脚本的执行时间 - CSDN博客

300 阅读1分钟
原文链接: blog.csdn.net
版权声明:本文为Sunface(孙飞)原创文章,转载请注明出处 https://blog.csdn.net/abv123456789/article/details/24522511 Linux 计算shell脚本的执行时间

#!/bin/bash start=`date +%s` ls -al >/dev/ null 2>&1

sleep 5s end=`date +%s` dif=$ [ end - start ] echo $dif