I’d like to benchmark a PHP script, but this would equally apply to anything that can be run from the command line.
Using bash is there a simple way to benchmark a script, i.e. run a command multiple times and time how long it takes?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In command line, you can:
Here
timeis a bash built-in.For multiple runs:
However, you need to calculate the average time by hand.