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
2ee99f74
Commit
2ee99f74
authored
Jul 26, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed profiling timers for compilation under Win32 (and hopefully Mac OS too).
parent
1fa882db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
12 deletions
+1
-12
profile.h
common/profile.h
+1
-12
No files found.
common/profile.h
View file @
2ee99f74
...
@@ -30,10 +30,7 @@
...
@@ -30,10 +30,7 @@
#ifndef __PROFILE_H
#ifndef __PROFILE_H
#define __PROFILE_H
#define __PROFILE_H
#ifdef __linux__
#include <sys/time.h>
#include <sys/time.h>
#endif
#include <stdint.h>
#include <stdint.h>
/**
/**
...
@@ -95,15 +92,10 @@ static __inline__ unsigned long long rdtsc()
...
@@ -95,15 +92,10 @@ static __inline__ unsigned long long rdtsc()
*/
*/
static
inline
uint64_t
get_tics
()
static
inline
uint64_t
get_tics
()
{
{
#if defined(__linux__)
struct
timeval
tv
;
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
gettimeofday
(
&
tv
,
NULL
);
return
(
uint64_t
)
tv
.
tv_sec
*
1000000ULL
+
(
uint64_t
)
tv
.
tv_usec
;
return
(
uint64_t
)
tv
.
tv_sec
*
1000000ULL
+
(
uint64_t
)
tv
.
tv_usec
;
#elif defined _WIN32 || defined _WIN64
return
GetTickCount
()
*
1000
;
#else
return
0
;
#endif
#endif
}
}
...
@@ -152,6 +144,3 @@ static inline void prof_end( prof_counter* cnt )
...
@@ -152,6 +144,3 @@ static inline void prof_end( prof_counter* cnt )
else
else
cnt
->
value
=
get_tics
()
-
cnt
->
value
;
cnt
->
value
=
get_tics
()
-
cnt
->
value
;
}
}
#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