Win has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way of measuring CPU activity through a Perl program on Windows? Do I use a system call or do I use a Perl module?

2005-09-03 Retitled by holli, as per Monastery guidelines
Original title: 'CPU'

  • Comment on How Do I Get CPU Utilization In Windows

Replies are listed 'Best First'.
Re: How Do I Get CPU Utilization In Windows
by puploki (Hermit) on Sep 02, 2005 at 11:56 UTC
    Under Windows, the CPU utilisation is exposed through the (WMI) performance counters. You can use the Win32::Perflib module to interface to the counters with Perl.

    It's not the most obvious module to use, however I found an article through Google that shows you how to use it (including pulling out CPU usage information).

    HTH,
    --Loki

Re: How Do I Get CPU Utilization In Windows
by sh1tn (Priest) on Sep 02, 2005 at 12:50 UTC
    You may find useful the scripting tools which generate vbs, wmi, python
    and most importantly of course - pl scripts.