Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/162.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 奇怪的boost::这个线程::睡眠行为_C++_Multithreading_Boost - Fatal编程技术网

C++ 奇怪的boost::这个线程::睡眠行为

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::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.020000s system = 0.030000s CPU (118.9%)

为什么它0.025242s而不是0.0025242s

因为25毫秒是0.025秒;0.0025秒等于2.5毫秒