Split winapi.hpp across win32-specific headers, added BOOST_USE_WINDOWS_H option.

[SVN r17277]
This commit is contained in:
Peter Dimov
2003-02-08 16:05:46 +00:00
parent 4b502993b5
commit 4244992d4d
6 changed files with 116 additions and 130 deletions
+8 -6
View File
@@ -152,11 +152,13 @@ int const m = 16; // threads
int main()
{
std::printf("%s: %s, %d threads, %d iterations: ", title, implementation, m, n);
using namespace std; // printf, clock_t, clock
printf("%s: %s, %d threads, %d iterations: ", title, implementation, m, n);
boost::shared_ptr<int> pi(new int(42));
std::clock_t t = std::clock();
clock_t t = clock();
pthread_t a[m];
@@ -165,14 +167,14 @@ int main()
a[i] = createThread( boost::bind(test, pi) );
}
for(int i = 0; i < m; ++i)
for(int j = 0; j < m; ++j)
{
pthread_join(a[i], 0);
pthread_join(a[j], 0);
}
t = std::clock() - t;
t = clock() - t;
std::printf("\n\n%.3f seconds.\n", static_cast<double>(t) / CLOCKS_PER_SEC);
printf("\n\n%.3f seconds.\n", static_cast<double>(t) / CLOCKS_PER_SEC);
return 0;
}
+6 -2
View File
@@ -25,17 +25,21 @@ int const n = 8 * 1024 * 1024;
int main()
{
using namespace std;
std::vector< boost::shared_ptr<int> > v;
boost::shared_ptr<int> pi(new int);
std::clock_t t = std::clock();
clock_t t = clock();
for(int i = 0; i < n; ++i)
{
v.push_back(pi);
}
t = std::clock() - t;
t = clock() - t;
std::cout << static_cast<double>(t) / CLOCKS_PER_SEC << '\n';
return 0;
}