[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linrad] Re: Resources
This is for native code - you can either go thru the (older) registry
interface, or the newer Pdh interface
For C#/.net stuff this little snip (borrowed from the PowerSDR source code)
will do the job:
private static PerformanceCounter cpu_usage;
public static float CpuUsage
{
get
{
if (cpu_usage == null)
{
cpu_usage = new PerformanceCounter(
"Processor", "% Processor
Time", "_Total", true);
}
return cpu_usage.NextValue();
}
}
PerformanceCounter is the package System.Diagnostics
Cheers,
Bill (kd5tfd)
At 05:58 PM 8/25/2005, Joe Taylor wrote:
Stan --
I believe the question Leif was asking -- and which I would like to have
an answer for, as well -- is how a running program can interrogate the
Windows system to find out what fraction of the system's time is being
spent in its "idle loop." The difference between this fraction and 1.0 is
the "CPU utilization".
-- Joe, K1JT
#############################################################
This message is sent to you because you are subscribed to
the mailing list <linrad@xxxxxxxxxxxxxxxxxxxxx>.
To unsubscribe, E-mail to: <linrad-off@xxxxxxxxxxxxxxxxxxxxx>
To switch to the DIGEST mode, E-mail to <linrad-digest@xxxxxxxxxxxxxxxxxxxxx>
To switch to the INDEX mode, E-mail to <linrad-index@xxxxxxxxxxxxxxxxxxxxx>
Send administrative queries to <linrad-request@xxxxxxxxxxxxxxxxxxxxx>
LINRADDARNIL