Diff
Not logged in

Differences From Artifact [a693a9224e]:

To Artifact [26d0f63b58]:


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
static DWORD WINAPI	CalibrationThread(LPVOID arg);
static void		UpdateTimeEachSecond(void);
static void		ResetCounterSamples(unsigned long long fileTime,
			    long long perfCounter, long long perfFreq);
static long long	AccumulateSample(long long perfCounter,
			    unsigned long long fileTime);
static long long	NativeGetMicroseconds(void);
void			GetTime(Tcl_Time *timePtr);

/*
 *----------------------------------------------------------------------
 *
 * TclpGetSeconds --
 *
 *	This procedure returns the number of seconds from the epoch. On most







|







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
static DWORD WINAPI	CalibrationThread(LPVOID arg);
static void		UpdateTimeEachSecond(void);
static void		ResetCounterSamples(unsigned long long fileTime,
			    long long perfCounter, long long perfFreq);
static long long	AccumulateSample(long long perfCounter,
			    unsigned long long fileTime);
static long long	NativeGetMicroseconds(void);
static void		GetTime(Tcl_Time *timePtr);

/*
 *----------------------------------------------------------------------
 *
 * TclpGetSeconds --
 *
 *	This procedure returns the number of seconds from the epoch. On most
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer
     */

    if (usecSincePosixEpoch = NativeGetMicroseconds()) {
	return usecSincePosixEpoch / 1000000;
    } else {
	Tcl_Time t;

	GetTime(&t);
	return (unsigned long long)t.sec;
    }







|







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer
     */

    if ( (usecSincePosixEpoch = NativeGetMicroseconds()) ) {
	return usecSincePosixEpoch / 1000000;
    } else {
	Tcl_Time t;

	GetTime(&t);
	return (unsigned long long)t.sec;
    }
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer.
     */

    if (usecSincePosixEpoch = NativeGetMicroseconds()) {
	return (Tcl_WideUInt) usecSincePosixEpoch;
    } else {
	/*
	* Use the Tcl_GetTime abstraction to get the time in microseconds, as
	* nearly as we can, and return it.
	*/








|







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer.
     */

    if ( (usecSincePosixEpoch = NativeGetMicroseconds()) ) {
	return (Tcl_WideUInt) usecSincePosixEpoch;
    } else {
	/*
	* Use the Tcl_GetTime abstraction to get the time in microseconds, as
	* nearly as we can, and return it.
	*/

303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer.
     */

    if (usecSincePosixEpoch = NativeGetMicroseconds()) {
	return usecSincePosixEpoch;
    } else {
	/*
	 * Use the Tcl_GetTime abstraction to get the time in microseconds, as
	 * nearly as we can, and return it.
	 */








|







303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer.
     */

    if ( (usecSincePosixEpoch = NativeGetMicroseconds()) ) {
	return usecSincePosixEpoch;
    } else {
	/*
	 * Use the Tcl_GetTime abstraction to get the time in microseconds, as
	 * nearly as we can, and return it.
	 */

350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer.
     */

    if (usecSincePosixEpoch = NativeGetMicroseconds()) {
	timePtr->sec = usecSincePosixEpoch / 1000000;
	timePtr->usec = (long)(usecSincePosixEpoch % 1000000);
    } else {
	GetTime(timePtr);
    }
}








|







350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
{
    long long usecSincePosixEpoch;

    /*
     * Try to use high resolution timer.
     */

    if ( (usecSincePosixEpoch = NativeGetMicroseconds()) ) {
	timePtr->sec = usecSincePosixEpoch / 1000000;
	timePtr->usec = (long)(usecSincePosixEpoch % 1000000);
    } else {
	GetTime(timePtr);
    }
}