⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcal.cpp

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 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 + -