ACE_Profile_Timer用法

本文介绍了ACE_Profile_Timer的使用方法,该工具可用于计算程序运行时的资源消耗情况。通过实例展示了如何启动和停止计时器,并获取墙上时间、用户时间和系统时间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


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.
*/
 
              


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值