现在的位置: 首页 > 综合 > 正文

ACE_Profile_Timer用法

2018年05月13日 ⁄ 综合 ⁄ 共 707字 ⁄ 字号 评论关闭


ACE_Profile_Timer的用法

ACE_Profile_Timer提供了一个简易的计算资源使用情况的接口

使用时声明如下对象:
ACE_Profile_Timer timer;
timer.start();
//....your operation
timer.stop();
ACE_Profile_Timer::ACE_Elapsed_Time elapse_time;
timer.elapsed_time(elapse_time);

其中:elapse_time是一个结构体,包括以下3个部分:
 class ACE_Elapsed_Time
 {
 public:
    /// Elapsed wall clock time.
    ACE_timer_t real_time;
 

   /// CPU time spent in user space.
    ACE_timer_t user_time;

   
   /// CPU time spent in system space.
   ACE_timer_t system_time;
 };               
 
摘抄stackoverflow上对墙上时间、CPU时间和system_time的解释
/*
Wall clock time is exactly what it says, the time elapsed as measured by the clock on your wall (or wristwatch)

User cpu time is the time spent in "user land", that is time spent on non-kernel processes

System cpu time is time spent in the kernel, usually time spent servicing system calls.

*/
 
              

抱歉!评论已关闭.