0

I am working in a C++ application where I need to check the timing when OS has booted. Is there any way to retrieve that time?

I tried GetTickCount64() function but it is returning the time when my exe has started. ULONGLONG tm = GetTickCount64();

I would like to know when windows has booted.

  • Can you show a [mcve] of how you're using the value returned from `GetTickCount64`? I don't believe it is broken but it's possible how you're using it is incorrect. – Retired Ninja Feb 22 '23 at 06:34
  • What does it mean that "windows has booted"? Do you mean time since power-on? Or time since all of Windows startup routined finished executing and the system was idle and ready for use? Or something else? – Jeremy Friesner Feb 22 '23 at 06:35
  • @JeremyFriesner I am looking for the time since the power is on. – vrajeshirke Feb 22 '23 at 06:38
  • Hmm, the GetTickCount64() function is documented as "Retrieves the number of milliseconds that have elapsed since the system was started", which is pretty unambiguous; so if that isn't the behavior you are seeing from that function, something quite strange must be going on. – Jeremy Friesner Feb 22 '23 at 06:59

0 Answers0