1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/*
* tclWinTime.c --
*
* Contains Windows specific versions of Tcl functions that
* obtain time values from the operating system.
*
* Copyright 1995-1998 by Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclWinTime.c,v 1.15 2003/04/12 19:08:56 kennykb Exp $
*/
#include "tclWinInt.h"
#define SECSPERDAY (60L * 60L * 24L)
#define SECSPERYEAR (SECSPERDAY * 365L)
#define SECSPER4YEAR (SECSPERYEAR * 4L + SECSPERDAY)
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/*
* tclWinTime.c --
*
* Contains Windows specific versions of Tcl functions that
* obtain time values from the operating system.
*
* Copyright 1995-1998 by Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclWinTime.c,v 1.16 2003/04/14 02:36:58 mdejong Exp $
*/
#include "tclWinInt.h"
#define SECSPERDAY (60L * 60L * 24L)
#define SECSPERYEAR (SECSPERDAY * 365L)
#define SECSPER4YEAR (SECSPERYEAR * 4L + SECSPERDAY)
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
{ NULL },
0,
0,
(HANDLE) NULL,
(HANDLE) NULL,
(HANDLE) NULL,
#ifdef HAVE_CAST_TO_UNION
(ULARGE_INTEGER) (DWORDLONG) 0,
(LARGE_INTEGER) (LONGLONG) 0,
(LARGE_INTEGER) (LONGLONG) 0,
#else
0,
0,
0,
#endif
0,
0,
0,
{ 0 },
{ 0 },
0,
0
};
CONST static FILETIME posixEpoch = { 0xD53E8000, 0x019DB1DE };
/*
* Declarations for functions defined later in this file.
|
>
<
<
<
>
<
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
{ NULL },
0,
0,
(HANDLE) NULL,
(HANDLE) NULL,
(HANDLE) NULL,
#ifdef HAVE_CAST_TO_UNION
(LARGE_INTEGER) (LONGLONG) 0,
(ULARGE_INTEGER) (DWORDLONG) 0,
(LARGE_INTEGER) (LONGLONG) 0,
(LARGE_INTEGER) (LONGLONG) 0,
#else
0,
0,
0,
0,
#endif
{ 0 },
{ 0 },
0
};
CONST static FILETIME posixEpoch = { 0xD53E8000, 0x019DB1DE };
/*
* Declarations for functions defined later in this file.
|
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
|
/*
* Store the current sample into the circular buffer of samples,
* and estimate the performance counter frequency.
*/
estFreq = AccumulateSample( curPerfCounter.QuadPart,
curFileTime.QuadPart );
/*
* We want to adjust things so that time appears to be continuous.
* Virtual file time, right now, is
*
* vt0 = 10000000 * ( curPerfCounter - perfCounterLastCall )
* / curCounterFreq
|
|
|
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
|
/*
* Store the current sample into the circular buffer of samples,
* and estimate the performance counter frequency.
*/
estFreq = AccumulateSample( curPerfCounter.QuadPart,
(ULONGLONG) curFileTime.QuadPart );
/*
* We want to adjust things so that time appears to be continuous.
* Virtual file time, right now, is
*
* vt0 = 10000000 * ( curPerfCounter - perfCounterLastCall )
* / curCounterFreq
|