Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
f8da2a2f
Commit
f8da2a2f
authored
Feb 12, 2022
by
Deucе
👌🏾
Browse files
More Win32 optimizations.
parent
f0a83672
Pipeline
#2722
failed with stage
in 8 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
src/xpdev/genwrap.c
src/xpdev/genwrap.c
+22
-7
No files found.
src/xpdev/genwrap.c
View file @
f8da2a2f
...
...
@@ -842,20 +842,35 @@ uint64_t xp_timer64(void)
else
ret
=
-
1
;
#elif defined(_WIN32)
static
BOOL
can_use_QPF
=
TRUE
;
static
BOOL
intable
=
FALSE
;
static
BOOL
intable_tested
=
FALSE
;
LARGE_INTEGER
freq
;
static
BOOL
initialized
=
FALSE
;
static
uint32_t
msfreq
;
static
double
msdfreq
;
LARGE_INTEGER
tick
;
if
(
QueryPerformanceFrequency
(
&
freq
)
&&
QueryPerformanceCounter
(
&
tick
))
{
if
(
!
intable_tested
)
{
if
(
!
initialized
)
{
if
(
!
QueryPerformanceFrequency
(
&
freq
))
can_use_QPF
=
FALSE
;
else
intable
=
(
freq
.
QuadPart
%
1000
)
==
0
;
intable_tested
=
TRUE
;
if
(
intable
)
msfreq
=
freq
.
QuadPart
/
1000
;
else
msdfreq
=
((
double
)
freq
.
QuadPart
)
/
1000
;
initialized
=
TRUE
;
}
if
(
can_use_QPF
)
{
if
(
!
QueryPerformanceCounter
(
&
tick
))
{
can_use_QPF
=
FALSE
;
return
GetTickCount
();
}
if
(
intable
)
ret
=
tick
.
QuadPart
/
(
freq
.
QuadPart
/
1000
)
;
ret
=
tick
.
QuadPart
/
ms
freq
;
else
ret
=
(
uint64_t
)(
((
double
)
tick
.
QuadPart
)
/
(((
double
)
freq
.
QuadPart
)
/
1000
))
;
ret
=
((
double
)
tick
.
QuadPart
)
/
msdfreq
;
}
else
{
ret
=
GetTickCount
();
...
...
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