我想计算程序执行的时间,所以在程序的开始和结束必须得到时间,请问改如何得到?

解决方案 »

  1.   

    恩~
    通过上面的函数可以实现~~~
    BOOL SetFileToCurrentTime(HANDLE hFile)
    {
        FILETIME ft;
        SYSTEMTIME st;
        BOOL f;    GetSystemTime(&st);              // gets current time
        SystemTimeToFileTime(&st, &ft);  // converts to file time format
        f = SetFileTime(hFile,           // sets last-write time for file
            (LPFILETIME) NULL, (LPFILETIME) NULL, &ft);    return f;
    }