- 检查一组代码从执行开始到执行完毕的时间。
#!/bin/bash start=$(date +%s) commands; statements; end=$(date +%s) difference=$(( end - start )) echo Time taken to execute commands is $difference seconds.
时间: 2024-10-09 08:24:58
#!/bin/bash start=$(date +%s) commands; statements; end=$(date +%s) difference=$(( end - start )) echo Time taken to execute commands is $difference seconds.