I have a shell command that I would like to time (e.g., a curl query). I don't want to time it once, but instead many times, so that I can get an empirical distribution of the execution time. How can I do so?

I'm guessing that I could write some program any language to loop around the time program, but I was hoping for a more off-the-shelf solution.


Would something like this work for you?

for f in `seq 10`
    time curl www.google.com
  • Thanks I was hoping for something a bit more advanced e.g. providing empirical distribution statistics such as mean and standard deviation. – Franck Dernoncourt Oct 27 '20 at 2:37
  • You could pipe it into a file and do do some fancy greps and cuts and stuff? – Chai Ang Oct 27 '20 at 6:26
  • Yes. I was hoping for a more off-the-shelf solution since that seemed to me to be a quite common need, but perhaps it doesn't exist and indeed we have to code it ourselves :) – Franck Dernoncourt Oct 27 '20 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.