例如我对一幅图像进行均值滤波,那么如何计算出处理这幅图像所要用的时间,感谢。

解决方案 »

  1.   


    LARGE_INTEGER tBefore, tAfter, i64PerfFrequency;
    // Figure out how often the performance counter increments
    QueryPerformanceFrequency( &i64PerfFrequency );// Get performance counter before the ANSI API loop
    QueryPerformanceCounter( &tBefore );//run your code here
    ……// Get performance counter after the ANSI API loop
    QueryPerformanceCounter( &tAfter );double tSecond = (double)(tAfter.QuadPart - tBefore.QuadPart)/(double)i64PerfFrequency.QuadPart;
      

  2.   

    DWORD t = timeGetTime();
    处理图像
    DWORD tt= timeGetTime() - t;
    cout<<tt;
      

  3.   

    C++有个类clock_t 获取当前时间,(ms级),你在图像处理的开始和末尾分别获取时间,他们的差就是经过的时间(ms)
      

  4.   

    #include <ctime>
    using namespace std;time_t tBegin, tEnd;tBegin = clock();
    ........
    tEnd = clock(); double(tEnd-tBegin)/CLOCKS_PER_SEC