summaryrefslogtreecommitdiff
path: root/navit/debug.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-31 01:53:24 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-31 01:53:24 +0000
commitbdeba8bee43fa890a243796b7dcf7b475d56979b (patch)
tree68dc540587f8617a5cf602a2f03b260ff9e49906 /navit/debug.c
parenta08d60deb7d3cbadac8637dab378d76292c48abb (diff)
downloadnavit-bdeba8bee43fa890a243796b7dcf7b475d56979b.tar.gz
Add:Core:Better timestamping of wince debug messages
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3324 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/debug.c')
-rw-r--r--navit/debug.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/navit/debug.c b/navit/debug.c
index 8b35401b7..fc6511cdf 100644
--- a/navit/debug.c
+++ b/navit/debug.c
@@ -34,7 +34,7 @@
#include <android/log.h>
#endif
-#ifdef DEBUG_WIN32_CE_MESSAGEBOX
+#ifdef HAVE_API_WIN32_CE
#include <windows.h>
#include <windowsx.h>
#endif
@@ -127,6 +127,16 @@ debug_level_get(const char *name)
static void debug_timestamp(FILE *fp)
{
+#ifdef HAVE_API_WIN32_CE
+ LARGE_INTEGER counter, frequency;
+ double val;
+ QueryPerformanceCounter(&counter);
+ QueryPerformanceFrequency(&frequency);
+ val=counter.HighPart * 4294967296.0 + counter.LowPart;
+ val/=frequency.HighPart * 4294967296.0 + frequency.LowPart;
+ fprintf(fp,"%.6f|",val);
+
+#else
struct timeval tv;
if (gettimeofday(&tv, NULL) == -1)
@@ -138,6 +148,7 @@ static void debug_timestamp(FILE *fp)
(int)(tv.tv_sec/60)%60,
(int)tv.tv_sec % 60,
(int)tv.tv_usec/1000);
+#endif
}
void