No documented maximum relative error bound applies between the GetProcessTimes exit timestamp and a later GetSystemTimePreciseAsFileTime reading, even when a successful wait establishes that process termination occurred before the precise UTC call.
What is documented
-
GetProcessTimesreturns the process exit time as a point in time represented by aFILETIME: a 64-bit count of 100-nanosecond units since January 1, 1601. If the process has not exited, the exit-time output is undefined. The documentation does not specify:- the exact termination step at which the value is captured;
- whether it is sampled before, during, or after any particular cleanup step;
- its effective resolution or maximum error;
- its rounding or truncation rule;
- a relationship to QPC or to a subsequent precise system-time reading.
^1^
-
GetSystemTimePreciseAsFileTimereturns the current UTC system time with the highest available precision, documented as less than one microsecond. It is intended for high-resolution UTC time-of-day measurements, not for establishing the accuracy of another API’s previously stored timestamp.^2^ - The corresponding kernel documentation explains the precise-time mechanism:
KeQuerySystemTimePrecisecombines the most recent system-clock value with elapsed time measured by the performance counter and reports accuracy within a microsecond. That guarantee concerns the precise read itself; it does not propagate backward to the process exit timestamp.^3^
Thus, subtracting the values produces an observed difference in their common UTC-based representation, but no documented API contract turns that difference into a bounded measurement of the interval from exit-time recording to the precise read.
Termination ordering versus timestamp semantics
A process object becomes signaled when the process terminates, and waiting threads are then released. The general termination sequence includes setting the exit code and signaling the process object.^4^
For the termination path caused by returning from managed Main, the documented native behavior is that returning from main results in ExitProcess. Its sequence places the process status change before the process object becomes signaled.^5^ A successful WaitForSingleObject on that handle therefore establishes synchronization with the signaled process object.^6^
However, these pages do not place the internal exit-time assignment at a named step in that sequence. Consequently, they establish:
process terminated and object signaled
happens before
successful wait returns
happens before
GetSystemTimePreciseAsFileTime call
They do not establish a documented maximum for:
precise UTC reading - stored process exit time
Nor do they define whether the exit timestamp denotes entry into termination, final-thread termination, exit-status assignment, process-object signaling, or another internal point.
Clock source, representation, and rounding
PsGetProcessExitTime says that it returns the current process’s exit time in system-time format and describes system time as typically updated approximately every ten milliseconds.^7^ That wording is:
- a description of typical update behavior, not a maximum-error guarantee;
- not a rounding specification;
- not an explicit statement that user-mode
GetProcessTimesobtains its value through that routine; - not a cross-API guarantee relative to precise system time.
The more detailed system-time documentation says ordinary KeQuerySystemTime is based on the latest clock tick, whose period is typically 500 microseconds to 15.625 milliseconds, and is accurate within one tick.^3^ Nothing supplied for GetProcessTimes explicitly promises that particular sampling or accuracy model for its exit field. It therefore cannot safely be imported as the exit timestamp’s contractual bound.
The 100-nanosecond FILETIME unit is only the encoding granularity. It does not establish 100-nanosecond source resolution, precision, rounding behavior, or accuracy.
QPC and UTC adjustments
QPC is an interval clock independent of external time references. GetSystemTimePreciseAsFileTime supplies UTC-synchronized time, while QPC is recommended for measuring short intervals on one system or VM.^8^ Bracketing the calls with QPC can bound when each API call executed in the collector, but it cannot determine when the historical exit value was captured unless Windows documents a mapping from that event to QPC.
System time may also be adjusted forward or backward during synchronization, and Microsoft explicitly warns against using system-time readings to measure elapsed time.^9^ An unchanged QPC frequency does not rule out such UTC adjustment because QPC frequency is not the UTC discipline state.
Scope of the conclusion
For Windows build 26100, the cited public API contracts provide no build-specific extension to this behavior. They also provide no distinct timestamp bounds for normal ExitProcess, TerminateProcess, fatal-exception, last-thread, shutdown, or other termination paths. Different paths have documented termination behavior—for example, external TerminateProcess is asynchronous until a wait confirms termination—but no documented exit-time accuracy contract is attached to them.^10^
Your ten observations support only the implementation behavior seen in that Sandbox run. They cannot establish a portable maximum, rounding rule, or guarantee for other builds, servicing revisions, hypervisors, clock adjustments, or termination paths. Establishing such a bound would require an additional Microsoft specification explicitly defining the recording instant and error model; those details are not present in the public contracts cited here.
References
- GetProcessTimes function (processthreadsapi.h)
- GetSystemTimePreciseAsFileTime function (sysinfoapi.h)
- KeQuerySystemTimePrecise function (wdm.h)
- Terminating a Process
- ExitProcess function (processthreadsapi.h)
- WaitForSingleObject function (synchapi.h)
- PsGetProcessExitTime function (ntifs.h)
- Acquiring high-resolution time stamps
- System Time
- TerminateProcess function (processthreadsapi.h)