Added a timing test for the single/multi threaded perf ratio (~2:1)

[SVN r12821]
This commit is contained in:
Peter Dimov
2002-02-15 18:06:17 +00:00
parent 862dc0001f
commit 875bab352c

View File

@ -0,0 +1,23 @@
#include <boost/shared_ptr.hpp>
#include <iostream>
#include <vector>
#include <ctime>
int const n = 8 * 1024 * 1024;
int main()
{
std::vector< boost::shared_ptr<int> > v;
boost::shared_ptr<int> pi(new int);
std::clock_t t = std::clock();
for(int i = 0; i < n; ++i)
{
v.push_back(pi);
}
t = std::clock() - t;
std::cout << static_cast<double>(t) / CLOCKS_PER_SEC << '\n';
}