📄 tcal.cpp
字号:
// TCAL.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#define CAL_TIME_MSEC 30000 // 30 sec calibration interval
int _tmain(int argc, TCHAR *argv[], TCHAR *envp[])
{
SYSTEMTIME sysTime;
DWORD baseTickCount, tickCount, baseIdleCount, idleCount;
int i;
_tprintf(_T("Starting timer calibration. Time message will be sent every %d sec.\r\n"), CAL_TIME_MSEC/1000);
for (i = 0; i < 10; i++)
{
baseTickCount = GetTickCount();
baseIdleCount = GetIdleTime();
Sleep(CAL_TIME_MSEC);
GetSystemTime(&sysTime);
tickCount = GetTickCount();
idleCount = GetIdleTime();
_tprintf(_T("Time = %u:%02u:%02u CurMSec = %u Idle = %d%%\r\n\r\n"),
sysTime.wHour, sysTime.wMinute, sysTime.wSecond, tickCount,
(100 * (idleCount - baseIdleCount)) / (tickCount - baseTickCount));
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -