/** * Benchmarks for sstring.h * * @author David Manura, 2006-07 * (c) 2006 David Manura * Distributed under the Boost Software License, Version 1.0. (www.boost.org) */ #include "sstring.h" #include #include #include using namespace boost; using namespace std; const int num_loops = 5000000; template void compare() { for (int n=0; n<3; n++) { clock_t t0 = clock(); T1::run(); clock_t t1 = clock(); T2::run(); clock_t t2 = clock(); T3::run(); clock_t t3 = clock(); cout << (t1 - t0) << " " << (t2 - t1) << " " << (t3 - t2) << endl; } } struct test1_sstring { static void run() { for (int n=0; n s; s += "12345678901234567890"; s += s; } } }; struct test1_string { static void run() { for (int n=0; n(); //test1_c>(); cout << "end" << endl; return 0; }