#include <iostream>
#include <boost/timer.hpp>
using namespace std;
int main()
{
boost::timer t;
for (long i = 100000; i > 0; --i)
for (long j = 100000; j > 0; --j);
cout << "now time elapsed: " << t.elapsed() << "s" << endl;
system("PAUSE");
}
这么一段测试代码,输出时间“流逝”。
Debug下输出结果:

Release下输出结果:

这是为什么呢?是我的boost编译或者配置的不对?请大家指点。