私は現在、bash テスト フレームワークを作成しており、各テスト メソッドの実行にかかる時間を測定したいと考えています。さらに、これらを合計して、完全な実行時間を示したいと思います。
関数などの実行時間を測定するために使用できることは知っていますがtime
、個々の結果を保存して追加する方法がわかりません。
時間は実際に仕事に適したツールですか? または、次のようなものを使用する必要がありますdate
か?
コード例:
declare -a execution_times
# somehow measure execution time of test function
# add the individual execution time
execution_times+=(execution_time)
for execution_time in "${execution_times[@]}"; do
# compute full execution time
done