Add:Core:Better timestamping of wince debug messages
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 31 May 2010 01:53:24 +0000 (01:53 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 31 May 2010 01:53:24 +0000 (01:53 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3324 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/debug.c

index 8b35401..fc6511c 100644 (file)
@@ -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