ACE
日期时间类比较少,常用就是下面
2
个类
ACE_DateTime
ACE_Time_Value
ACE_DateTime 用于获得和设置当前日期/时间,其没有提供运算操作,精确到毫秒
ACE_Time_Value 主要用于时间统计,精确到微妙,提供了运算操作
要获得当前的时间,可调用 ACE_OS :: gettimeofday ()
其提供的 msec , usec 均表示当前变量中保存的时间的总和
如下:
ACE_Time_Value sdate ( ACE_OS :: gettimeofday ()) ;
...
ACE_Time_Value edate ( ACE_OS :: gettimeofday ()) ;
ACE_DEBUG (( LM_DEBUG , "总共历时%d毫秒!" ,( sdate - edate ). msec ()));
ACE_DEBUG (( LM_DEBUG , "总共历时%d微秒!" ,( sdate - edate ). usec ()));
ACE_DateTime 类提供了个 update 函数,用于和 ACE_Time_Value 进行交互
ACE_DateTime
ACE_Time_Value
ACE_DateTime 用于获得和设置当前日期/时间,其没有提供运算操作,精确到毫秒
ACE_Time_Value 主要用于时间统计,精确到微妙,提供了运算操作
要获得当前的时间,可调用 ACE_OS :: gettimeofday ()
其提供的 msec , usec 均表示当前变量中保存的时间的总和
如下:
ACE_Time_Value sdate ( ACE_OS :: gettimeofday ()) ;
...
ACE_Time_Value edate ( ACE_OS :: gettimeofday ()) ;
ACE_DEBUG (( LM_DEBUG , "总共历时%d毫秒!" ,( sdate - edate ). msec ()));
ACE_DEBUG (( LM_DEBUG , "总共历时%d微秒!" ,( sdate - edate ). usec ()));
ACE_DateTime 类提供了个 update 函数,用于和 ACE_Time_Value 进行交互