Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
5a9fcf6f
Commit
5a9fcf6f
authored
Jan 13, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix windows version of GetRunningMicroSecs()
parent
3421863c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
getrunningmicrosecs.cpp
common/getrunningmicrosecs.cpp
+21
-10
No files found.
common/getrunningmicrosecs.cpp
View file @
5a9fcf6f
...
...
@@ -40,23 +40,34 @@ unsigned GetRunningMicroSecs()
unsigned
GetRunningMicroSecs
()
{
LARGE_INTEGER
curtime
;
FILETIME
now
;
static
unsigned
timerFreq
;
// timer frequency
GetSystemTimeAsFileTime
(
&
now
);
if
(
!
timerFreq
)
{
QueryPerformanceFrequency
(
&
curtime
);
typedef
unsigned
long
long
UINT64
;
timerFreq
=
curtime
.
QuadPart
/
1000000
;
// i.e., ticks per usec
UINT64
t
=
(
UINT64
(
now
.
dwHighDateTime
)
<<
32
)
+
now
.
dwLowDateTime
;
assert
(
timerFreq
);
}
t
/=
10
;
QueryPerformanceCounter
(
&
curtime
);
return
unsigned
(
t
);
}
#if 0
// test program
#include <stdio.h>
int main( int argc, char** argv )
{
unsigned then = GetRunningMicroSecs();
return
(
curtime
.
LowPart
/
timerFreq
);
Sleep( 2000 ); // Windows Sleep( msecs )
printf( "delta: %u\n", GetRunningMicroSecs() - then );
return 0;
}
#endif
#endif
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