209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
+
-
-
+
+
-
-
+
+
+
+
+
|
static inline Tcl_WideInt
NativeCalc100NsOffs(
LONGLONG ciPerfCounter,
LONGLONG curCounter
) {
curCounter -= ciPerfCounter; /* current distance */
/* virtual time without offset (or nominal frequency equals 10000000) */
if (!curCounter) {
return 0; /* virtual time without offset */
if (!curCounter || timeInfo.nominalFreq == 10000000) {
return (Tcl_WideInt)curCounter;
}
/* virtual time with offset */
return curCounter * 10000000 / timeInfo.nominalFreq;
/* virtual time with offset, try to avoid overflow in signed wide int */
if (curCounter < WIDE_MAX / 10000000) {
return (Tcl_WideInt)curCounter * 10000000 / timeInfo.nominalFreq;
}
return (Tcl_WideInt)(curCounter / ((double)timeInfo.nominalFreq / 10000000));
}
/*
* Representing the number of 100-nanosecond intervals since posix epoch.
*/
static inline Tcl_WideInt
GetSystemTimeAsVirtual(void)
|