Bash | Measure the execution time
Measure the execution time
time
The time
that you are using is the bash shell built in time
which the only option is -p
The command "time" report a execution time information
1 |
|
Description:
Real
- time from start to finish.User
- the amount of CPU time spent in use-mode. It is actual CPU time used in executing the process.Sys
- the amount of CPU time spent in kernel.
date +%s
You can measure execution time by subtraction start date and end date:
1 |
|
> log 2>&1 &
1 |
|
tee
It basically breaks the output of a program so that it can be both displayed and saved in a file. It does both the tasks simultaneously, copies the result into the specified files or variables and also display the result.
1 |
|
References
Bash | Measure the execution time
https://waipangsze.github.io/2024/12/04/bash-Measure-the-execution-time/