MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / GetProcessCreationTime

Method GetProcessCreationTime

ProgramLog/log.cpp:18–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16std::weak_ptr<lazy_file_sink_mt> Log::s_LogSink;
17
18std::time_t Log::GetProcessCreationTime() noexcept
19{
20 FILETIME creationTime, exitTime, kernelTime, userTime;
21 if (GetProcessTimes(GetCurrentProcess(), &creationTime, &exitTime, &kernelTime, &userTime))
22 {
23 using winrt::clock;
24 return clock::to_time_t(clock::from_file_time(creationTime));
25 }
26 else
27 {
28 // Fallback to current time
29 using std::chrono::system_clock;
30 return system_clock::to_time_t(system_clock::now());
31 }
32}
33
34std::filesystem::path Log::GetPath(const std::optional<std::filesystem::path> &storageFolder)
35{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected