Windows System Idle Timer

Here’s the VB.Net class that does the API work:

 

To keep the system from idling to sleep:

 

To show the current system idle timer:

 

This code only affects the current thread. As soon as the thread closes the system is returned to its previous state.