Skip to content

Instantly share code, notes, and snippets.

@dantmnf
Last active December 17, 2015 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dantmnf/5690408 to your computer and use it in GitHub Desktop.
Save dantmnf/5690408 to your computer and use it in GitHub Desktop.
a small program to show the time spent from Windows startup
#define UNICODE
#include <windows.h>
#ifdef __GNUC__
#define wWinMain WinMain //MinGW does not support wWinMain
#define WINMAIN_CMDLINE_TYPE LPSTR
#else
#define WINMAIN_CMDLINE_TYPE LPWSTR
#endif
int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, WINMAIN_CMDLINE_TYPE lpCmdLine, int nCmdShow)
{
DWORD time = GetTickCount() / 1000;
WCHAR *buf = malloc(128);
wsprintf(buf, L"本次开机共用了%d秒。", time);
MessageBox(NULL, buf, L"Startup Time Monitor", MB_ICONINFORMATION);
free(buf);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment