Пример #1
0
 void test(long items) {
     long count = getCountWithDefault(items);
     std::cout << "*** Testing thread creation performance" 
             << std::endl;
     
     beginAction(1, "thread creation", count);
     reset();
     ThreadCreationPerformance* performance = 
             new ThreadCreationPerformance();
     for (long i = 0; i < count; ++i) {
         try {
             Thread* thread = new Thread(performance);
             thread->start();
             thread->join();
             delete thread;
             proceed();
         } catch (ThreadException& te)  {
             std::cerr << "Exception: " << te.message() << std::endl;
         }
     }
     delete performance;
     reset();
     endAction();
 }
Пример #2
0
 void test(unsigned long items, const char* description) {
     unsigned long count = getCountWithDefault(items);
     std::cout << "*** Testing " << description << std::endl;
     algorithm(count);
 }