// Copyright (c) 2006 // Christopher Baus http://baus.net/ (christopher at baus dot net) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include #include #include #include #include // Assumes that the switchflow directory is in the include path // and pooled_list class is in a subdirectory called util. #include template void test_performance(listT& l, int num_ops) { using namespace boost::posix_time; l.clear(); ptime start = microsec_clock::universal_time(); for(int x=0; x < num_ops; ++x){ for(int i = 0; i <10; ++i){ l.insert(l.begin(), i); } while(!l.empty()){ l.erase(l.begin()); } } ptime end = microsec_clock::universal_time(); std::cout< std_list; switchflow::util::pooled_list::pool list_pool(10); switchflow::util::pooled_list::pooled_list list1(list_pool); std::cout<<"done allocating..."< vect; test_performance(vect, 5000000); return 0; }