Function Reference


_Timer_GetIdleTime

Returns the number of ticks since last user activity (i.e. KYBD/Mouse)

#include <Timers.au3>
_Timer_GetIdleTime ( )

Return Value

Success: integer ticks since last (approx. milliseconds) since last activity
Failure: Sets @extended = 1 if rollover occurs (see remarks)

Remarks

The current ticks since last system restart will roll over to 0 every 50 days or so, which makes it possible for last user activity to be before the rollover, but run time of this function to be after the rollover.
If this happens, @extended = 1 and the returned value is ticks since rollover occured.

Example

#include <MsgBoxConstants.au3>
#include <Timers.au3>

; Mouse/Keyboard action during this 10 sec delay will change reported idle time
Sleep(10 * 1000); 10sec

Local $iIdleTime = _Timer_GetIdleTime()

MsgBox($MB_SYSTEMMODAL, "_Timer_GetIdleTime", "Idle time = " & $iIdleTime & "ms")