X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Lapo Luchini Subject: Re: System load question Date: Sat, 15 Dec 2007 13:13:10 +0100 Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0 In-Reply-To: OpenPGP: id=C8F252FB; url=http://www.lapo.it/pgpkey.txt X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com jurgen DOT defurne AT philips DOT com wrote: > Does the loadavg work however ? I found that system load can be somewhat seen with the following VBS script (available since WinXP): Set objWMIService = GetObject("winmgmts:root\cimv2") Set objRefresher = CreateObject("WbemScripting.Swbemrefresher") Set objProcessor = objRefresher.AddEnum(objWMIService, _ "Win32_PerfFormattedData_PerfOS_Processor").objectSet Do objRefresher.Refresh For Each intProcessorUse in objProcessor If intProcessorUse.Name = "_Total" Then WScript.StdOut.WriteLine _ FormatDateTime(Now,vbShortDate) & vbTab & _ FormatDateTime(Now,vbShortTime) & vbTab & _ intProcessorUse.PercentProcessorTime End If Next Wscript.Sleep 1000 ' Sleep in mSec. Loop I haven't investigated if it shows the instant load or the average over the sampling period, but I have the impression it is the latter. Lapo -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/