Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to call a program from a script, (malwarebytes, chkdsk, A/V scan) and have the script keep track of how long the program ran. Could someone point me in the direction of what I should be looking for to get this accomplished?

share|improve this question
You mean like time? – Ignacio Vazquez-Abrams May 17 '13 at 12:43

On Unix/Linux, you can use the time(1) command for this.

share|improve this answer

You can use the time command e.g.

time ls -lR
real    0m0.178s
user    0m0.034s
sys     0m0.104s
share|improve this answer

I'm assuming that you're talking about a Windows environment:

malwarebytes, chkdsk

There's a post on stackoverflow that covers multiple ways to accomplish your goal depending upon your OS version and tools available (PowerShell, notably).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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