|
|
@@ -153,17 +153,19 @@ LeakReport::EnsureLeakReportFile()
|
|
|
Print(_u("================================================================================\n"));
|
|
|
Print(_u("Chakra Leak Report - PID: %d\n"), ::GetCurrentProcessId());
|
|
|
|
|
|
- // xplat-todo: Make this code cross-platform
|
|
|
-#if _MSC_VER
|
|
|
- __time64_t time_value = _time64(NULL);
|
|
|
- char16 time_string[26];
|
|
|
struct tm local_time;
|
|
|
- _localtime64_s(&local_time, &time_value);
|
|
|
- _wasctime_s(time_string, &local_time);
|
|
|
- Print(time_string);
|
|
|
+ uint64_t time_ms = (uint64_t) PlatformAgnostic::DateTime::HiResTimer::GetSystemTime(); // utc
|
|
|
+ time_t time_sec = time_ms / 1000; // get rid of the milliseconds
|
|
|
+#ifdef _MSC_VER
|
|
|
+ _localtime64_s(&local_time, &time_sec);
|
|
|
+#else
|
|
|
+ localtime_r(&time_sec, &local_time);
|
|
|
#endif
|
|
|
+ Print(_u("%04d-%02d-%02d %02d:%02d:%02d.%03d\n"),
|
|
|
+ local_time.tm_year + 1900, local_time.tm_mon + 1, local_time.tm_mday,
|
|
|
+ local_time.tm_hour, local_time.tm_min, local_time.tm_sec,
|
|
|
+ time_ms % 1000);
|
|
|
|
|
|
- Print(_u("\n"));
|
|
|
return true;
|
|
|
}
|
|
|
|