If I understand std::chrono correctly, it lets your function declare what “fractions of a second” it accepts for time. And it lets the caller provide a time in terms of different fractions of a second (say 1/1000’s of a second), and the type conversion bridges the gap.
So functions that take time in 10*1ns chunks declare that in the function signature, rather than leaving it up to the caller to remember whether it takes those, or 1/1000s or 1/1000000 of a second.
-p
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Marion Bond
Sent: Tuesday, April 21, 2015 3:13 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: [ntdev] kcalloc equivalent
I would argue that an abstraction that is cross-platform is a stronger abstraction than one confined to a specific platform. You are right of course that an abstraction on a platform is vastly better than none at all
Sent from Surface Pro
From: xxxxx@osr.commailto:xxxxx
Sent: Tuesday, April 21, 2015 5:58 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
We have a very different definition of what “abstracted” time units mean then. “Abstracted” does not equal – and has no relation to I would argue – “cross-platform compatible.”
100ns units is the abstract and universal unit of time in the Windows kernel, in that is it the same across all Windows platforms and versions. It is NOT like “clock ticks”, which vary depending on the platform and/or version of the system. I remember those hassles from other platforms… “Which clock is in this system, and what is its frequency.” Very annoying.
So, yes… 100ns is the standard “abstract” unit of time on Windows… regardless of the clock tick. They COULD have chosen milliseconds. They COULD have chosen femptoseconds. But they chose 100ns units.
Peter
OSR
@OSRDrivers
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>