Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
79390e9d
Commit
79390e9d
authored
Oct 13, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed the Windows code by using native 64-bit int compiler support instead
of calling external functions.
parent
b3b9c20e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
Modules/_hotshot.c
Modules/_hotshot.c
+14
-11
No files found.
Modules/_hotshot.c
View file @
79390e9d
...
...
@@ -20,8 +20,12 @@
#include <windows.h>
#include <largeint.h>
#include <direct.h>
/* for getcwd() */
typedef
LARGE_INTEGER
hs_time
;
#define GETTIMEOFDAY(p) QueryPerformanceCounter(p)
typedef
__int64
hs_time
;
#define GETTIMEOFDAY(P_HS_TIME) \
{ LARGE_INTEGER _temp; \
QueryPerformanceCounter(&_temp); \
*(P_HS_TIME) = _temp.QuadPart; }
#else
#ifndef HAVE_GETTIMEOFDAY
...
...
@@ -664,12 +668,11 @@ get_tdelta(ProfilerObject *self)
int
tdelta
;
#ifdef MS_WIN32
hs_time
tv
;
LARGE_INTEGER
diff
;
hs_time
diff
;
QueryPerformanceCounter
(
&
tv
);
diff
=
LargeIntegerSubtract
(
tv
,
self
->
prev_timeofday
);
tdelta
=
diff
.
LowPart
;
GETTIMEOFDAY
(
&
tv
);
diff
=
tv
-
self
->
prev_timeofday
;
tdelta
=
(
int
)
diff
;
#else
struct
timeval
tv
;
...
...
@@ -764,7 +767,7 @@ calibrate(void)
hs_time
tv1
,
tv2
;
#ifdef MS_WIN32
LARGE_INTEGER
diff
;
hs_time
diff
;
QueryPerformanceFrequency
(
&
frequency
);
#endif
...
...
@@ -772,9 +775,9 @@ calibrate(void)
while
(
1
)
{
GETTIMEOFDAY
(
&
tv2
);
#ifdef MS_WIN32
diff
=
LargeIntegerSubtract
(
tv2
,
tv1
)
;
if
(
!
LargeIntegerEqualToZero
(
diff
)
)
{
timeofday_diff
=
diff
.
LowPart
;
diff
=
tv2
-
tv1
;
if
(
diff
!=
0
)
{
timeofday_diff
=
(
unsigned
long
)
diff
;
break
;
}
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment