SYSTEMTIME systime;
GetLocalTime(&systime);
TCHAR tcsystime[1024];
_stprintf(tcsystime,"%d/%d/%d,%d:%d:%d:%d  ",systime.wYear,systime.wMonth,systime.wDay,systime.wHour,systime.wMinute,systime.wSecond,systime.wMilliseconds);

解决方案 »

  1.   

    //Decription: delay timeS
    void CIdeApp::let_msg_go_and_wait(DWORD dwMS)
    {
        DWORD dwStart; 
        MSG msg;    dwStart=::GetTickCount();
    cont_wait:
        while ( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
        {
            if ( msg.message==WM_QUIT )
            {
                ::PostQuitMessage(-1);
                break;
            }
            if (!AfxGetApp()->PreTranslateMessage(&msg))
            {
                ::TranslateMessage(&msg);
                ::DispatchMessage(&msg);
            }
        }
        AfxGetApp()->OnIdle(0);
        AfxGetApp()->OnIdle(1);
        if (dwMS==0) return;
        if ((::GetTickCount()-dwStart)<dwMS) goto cont_wait;
    }
    这是消息处理的时间delay,应该可以!
      

  2.   

    http://www.naughter.com/cputicker.html
    另外CSDN上也有个例子
      

  3.   

    给分吧,人家计算CPU频率,然后计算时钟周期,没有比这更准的了!标题最后一栏,管理~