System Idle time 
Author Message
 System Idle time

How can I get the OS idle time?

--
Best Regards,

Ido Samuelson (Even-Ziv)
R&D Division
Galdor Systems LTD.

Tel: 972-8-9322-950
Fax: 972-8-9422-402
Mobile: 972-67-480-789



Mon, 06 Jun 2005 18:24:54 GMT  
 System Idle time
ManagementObject IdleProcess = new
ManagementObject("Win32_Process.Handle=0");
Console.WriteLine("Idle Time = {0}", (ulong)IdleProcess["KernelModeTime"]);

returns the System Idle time in units of 100ns, since the machine last
booted. Not very useful, but what you asked for. If you want to know how
much idle time there was between two points, this will be more useful;

PerformanceCounter percIdle = new PerformanceCounter("Processor", "% Idle
Time", "_Total");
for(int i=1; i < 10; i++)
{
    Console.WriteLine("% Idle Time = {0}", percIdle.NextValue());
    Thread.Sleep(10000);

Quote:
}

--
Nick Holmes
Coyote Software, GmbH.



Quote:
> How can I get the OS idle time?

> --
> Best Regards,

> Ido Samuelson (Even-Ziv)
> R&D Division
> Galdor Systems LTD.

> Tel: 972-8-9322-950
> Fax: 972-8-9422-402
> Mobile: 972-67-480-789



Mon, 06 Jun 2005 19:22:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. System Idle Time modification...

2. system idle time

3. System Idle Time modification...

4. How to detect system idle time?

5. How to determine system idle time without hooks?

6. Monitoring System Idle Time

7. execute on system idle time

8. Get system idle time

9. How to get system idle time or get notified after the system being idle for an extended time

10. How to get system idle time or get notified after the system being idle for an extended time

11. Getting idle time of system/os

12. How to obtain the login time and the idle time of the user

 

 
Powered by phpBB® Forum Software