PCL基础3:点云程序运行时间计时
生活随笔
收集整理的這篇文章主要介紹了
PCL基础3:点云程序运行时间计时
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在學習PCL官網程序--條件歐幾里得時,看到了計時器的用法,現做以總結:
方法1:
#include <pcl/console/time.h>pcl::console::TicToc tt;
tt.tic ();//寫入需要記錄執行多長時間的代碼(即需要計時的事件)std::cout << "[done, " << tt.toc () << " ms ]" << std::endl;
方法2:
#include <ctime>int main(int argc, char** argv)
{time_t begin, end;begin = clock(); //開始計時//-------------------------------------------------------------------------------//寫入需要計時執行的程序//--------------------------------------------------------------------------------------------end = clock(); //結束計時double Times = double(end - begin) / CLOCKS_PER_SEC; //將clock()函數的結果轉化為以秒為單位的量std::cout << "time: " << Times << "s" << std::endl;return 0;
}
?
總結
以上是生活随笔為你收集整理的PCL基础3:点云程序运行时间计时的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PCL:官方程序 Region grow
- 下一篇: PCL基础1:点云数据结构