Windows kernel equivalent to FreeBSD's ticks or Linux' jiffies in the latest WDK
I am working on a Windows NDIS driver using the latest WDK that is in need of a millisecond resolution kernel time counter that is monotonically non-decreasi开发者_如何学运维ng. I looked through MSDN as well as WDK's documentation but found nothing useful except something called TsTime, which I am not sure whether is just a made-up name for an example or an actual variable. I am aware of NDISGetCurrentSystemTime, but would like to have something that is lower-overhead like ticks or jiffies, unless NDISGetCurrentSystemTime itself is low-overhead.
It seems that there ought to be a low-overhead global variable that stores some sort of kernel time counter. Anyone has insight on what this may be?
Use KeQueryTickCount
. And perhaps use KeQueryTimeIncrement
once to be able to convert the tick count into a more meaningful time unit.
How about GetTickCount
/ GetTickCount64
(Check the reqs on the latter)
精彩评论