[Lldb-commits] [lldb] r178124 - Implement "TimeVal" on Windows

Carlo Kok ck at remobjects.com
Wed Mar 27 02:05:19 PDT 2013


Author: carlokok
Date: Wed Mar 27 04:05:19 2013
New Revision: 178124

URL: http://llvm.org/viewvc/llvm-project?rev=178124&view=rev
Log:
Implement "TimeVal" on Windows

Modified:
    lldb/branches/windows/source/Host/common/TimeValue.cpp

Modified: lldb/branches/windows/source/Host/common/TimeValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/common/TimeValue.cpp?rev=178124&r1=178123&r2=178124&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/common/TimeValue.cpp (original)
+++ lldb/branches/windows/source/Host/common/TimeValue.cpp Wed Mar 27 04:05:19 2013
@@ -130,6 +130,14 @@ TimeValue::Now()
     struct timeval tv;
 #ifdef _POSIX_SOURCE
     gettimeofday(&tv, NULL);
+#else
+    SYSTEMTIME st;
+    GetSystemTime(&st);
+    tv.tv_usec = st.wMilliseconds * 1000;
+    FILETIME ft;
+    SystemTimeToFileTime(&st, &ft);
+
+    tv.tv_sec = ((((uint64_t)ft.dwHighDateTime) << 32 | ft.dwLowDateTime) / 10000000) - 11644473600ULL;
 #endif
     TimeValue now(tv);
     return now;





More information about the lldb-commits mailing list