I’m having trouble to determine how long system is running. I’m just too tired for now, but have nothing to do. I used GetTickCount() to get Milliseconds, but I have to convert them human readable format. I tried something like this but I get strange results.
void GetUpTime(DWORD Tick) //GetTickCount() argument.
{
wchar_t temp[256] = {0};
ZeroMemory(tmpBuff, sizeof(tmpBuff));
wsprintfW(temp, L"%uh %um %us", Tick/60, Tick/60*60, Tick/60*60*60);
lstrcpyW(Time, tmpBuff);
}
as I guess here, Tick/60 = seconds, Tick/60*60 = minutes and Tick/60*60*60 = hours. but I need something like: 1h 5m 36s not the whole conversation.
Regards.
Tick/60*60means the same thing as(Tick/60)*60, which is clearly not what you want. You likely meantTick/(60*60)instead.You can “peel off” each unit if you want something more readable: