_POWERCOUNT would be the current count of power events reported. That is, the same number as the "1" below.
Code:
Display (1/FOREVER) echo %_time - %_lastinput
Aren't you using RegisterPowerSettingNotification and getting notifications via WM_POWERBROADCAST? I was imagining the window process receiving those messages could get the time ASAP. Where does the 33 ms come in?
In a nutshell ... I use
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2)
to turn off my monitors. 8-10 minutes later the monitors come on; input of unknown origin is generated and some combination of these is started: RuntimeBroker, AppXSvc, wuauserv, WaaSMedicSvc. I can get the process/service start times accurately with WMI but I can't get an accurate time of the input event. The best I can do is to use _TIME in POWERMONITOR's <command>. Getting the time as soon as TCC receives the power event would be better.
Ultimately, I want to figure out where the mysterious input is coming from and (more important) stop it from happening.