Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

There is a command in Linux that outputs system utilization called time. Is there a Windows equivalent? Or how else can I manually use the task manager commands in a batch file?

share|improve this question
    
Do you mean uptime? The time command simply benchmarks how long it takes to run a command. –  Kyle Smith Mar 26 '12 at 17:34
1  
No time is what I need. I want to benchmark how long it takes to run the command but I want to do it on Windows so I can do it in a batch file. –  hanleyhansen Mar 26 '12 at 17:38

3 Answers 3

The Windows Server 2003 Resource kit includes a timeit utility. The resource kit works fine on XP as well, and I've used the individual tools on newer Windows operating systems as well.

share|improve this answer
    
Ok is there one to measure cpu utilization? Not just time but utilization as well. –  hanleyhansen Mar 26 '12 at 18:20
    
not directly i know of, but process explorer may fit your requirements. technet.microsoft.com/en-us/sysinternals/bb896653 –  johnshen64 Mar 26 '12 at 18:43
    
I need a way to do it from the command prompt because eventually i need to do it in a batch script. –  hanleyhansen Mar 26 '12 at 18:56
1  
again in powershell, you can do: (get-process processname).cpu, where processname is the name of the process. this is only a snapshot at the tiem so you need to do some sort of summing/averaging etc. yourself. –  johnshen64 Mar 26 '12 at 19:52

If your Operating System has powershell (older operating systems might need a download), you can simply use Measure-Command cmdlet.

share|improve this answer
    
Ok is there one to measure cpu utilization? Not just time but utilization as well –  hanleyhansen Mar 26 '12 at 18:20

I found a tool which -- while not a direct port -- appears to give you the information you desire.

C:\> timemem "find \"e\" myfile.txt"

---------- MYFILE.TXT
>ONE Homo sapiens alu
>TWO IUB ambiguity codes
>THREE Homo sapiens frequency

Process ID: 476
    elapsed time (seconds): 5.81
    user time (seconds): 0.55
    kernel time (seconds): 0.30
    Page Fault Count: 3150
    Peak Working Set Size (kbytes): 12420
    Quota Peak Paged Pool Usage: 78324
    Quota Peak Non Paged Pool Usage: 2240
    Peak Pagefile Usage: 917504

timemem.exe is available from Andy Fingerhut's page of code and the timemem source is hosted on github as part of the clojure-benchmark repo.

Much detail is available in readme-timemem.txt, form where I copied the above example.

(found from this neglected answer over on superuser)

share|improve this answer

Your Answer

 
discard

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.