ACE_Profile_Timer用法

来源:互联网 发布:网络安全法 编辑:程序博客网 时间:2024/06/09 23:39

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.
*/
 
              
	
				
		
原创粉丝点击