| 171 | } |
| 172 | |
| 173 | static void getUptime(printInfoStruct& printInfo) |
| 174 | { |
| 175 | if (l_Debug) |
| 176 | std::wcout << L"Getting uptime in milliseconds" << '\n'; |
| 177 | |
| 178 | boost::chrono::milliseconds uptime = boost::chrono::milliseconds(GetTickCount64()); |
| 179 | |
| 180 | if (l_Debug) |
| 181 | std::wcout << L"Converting requested unit (default: seconds)" << '\n'; |
| 182 | |
| 183 | switch (printInfo.unit) { |
| 184 | case TunitH: |
| 185 | printInfo.time = boost::chrono::duration_cast<boost::chrono::hours>(uptime).count(); |
| 186 | break; |
| 187 | case TunitM: |
| 188 | printInfo.time = boost::chrono::duration_cast<boost::chrono::minutes>(uptime).count(); |
| 189 | break; |
| 190 | case TunitS: |
| 191 | printInfo.time = boost::chrono::duration_cast<boost::chrono::seconds>(uptime).count(); |
| 192 | break; |
| 193 | case TunitMS: |
| 194 | printInfo.time = uptime.count(); |
| 195 | break; |
| 196 | } |
| 197 | |
| 198 | // For the Performance Data we need the time in seconds |
| 199 | printInfo.timeInSeconds = boost::chrono::duration_cast<boost::chrono::seconds>(uptime).count(); |
| 200 | } |
| 201 | |
| 202 | int wmain(int argc, WCHAR **argv) |
| 203 | { |