C++ 奇怪的boost::这个线程::睡眠行为
我试图使用boost::this_thread::sleep在多线程代码中实现小的时间延迟。 下面是代码示例:C++ 奇怪的boost::这个线程::睡眠行为,c++,multithreading,boost,C++,Multithreading,Boost,我试图使用boost::this_thread::sleep在多线程代码中实现小的时间延迟。 下面是代码示例: { boost::timer::auto_cpu_timer t;//just to check sleep interval boost::this_thread::sleep(boost::posix_time::milliseconds(25)); } 自动cpu定时器产生的输出让我有点困惑: 0.025242s wall, 0.010000s user + 0
{
boost::timer::auto_cpu_timer t;//just to check sleep interval
boost::this_thread::sleep(boost::posix_time::milliseconds(25));
}
自动cpu定时器产生的输出让我有点困惑:
0.025242s wall, 0.010000s user + 0.020000s system = 0.030000s CPU (118.9%)
为什么它0.025242s而不是0.0025242s 因为25毫秒是0.025秒;0.0025秒等于2.5毫秒