Advertisement
Guest User

Untitled

a guest
Mar 31st, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. #define TXT1 "The", "cmake", "gui", "executable", "is", "the", "CMake", "GUI", "Project", "configuration", "settings"
  2. #define TXT2 "The cmake-gui executable is the CMake GUI.", "Project configuration settings may be specified interactively.Brief instructions are provided at the bottom of the window when the program is running." , "CMake is a cross-platform build system generator.", "Projects specify their build process with platform - independent CMake listfiles included in each directory of a source tree with the name CMakeLists.txt.", "Users build a project by using CMake to generate a build system for a native tool on their platform."
  3. #define TXT TXT2
  4.  
  5. int main()
  6. {
  7.     using namespace std;
  8.  
  9.     const int LOOPS = 10000;
  10.  
  11.     {
  12.         cout << "concat_string: ";
  13.         Stopwatch sw;
  14.         for (int i = LOOPS; i > 0; --i)
  15.         {
  16.             string s = concat_string(TXT);
  17.         }
  18.     }
  19.     {
  20.         cout << "append new vector: ";
  21.         Stopwatch sw;
  22.         for (int i = LOOPS; i > 0; --i)
  23.         {
  24.             string s;
  25.             vector<char*> arr = {TXT};
  26.             for (auto str : arr)
  27.             {
  28.                 s += str;
  29.             }
  30.         }
  31.     }
  32.     {
  33.         cout << "append preallocated vector: ";
  34.         Stopwatch sw;
  35.         vector<char*> arr = {TXT};
  36.         for (int i = LOOPS; i > 0; --i)
  37.         {
  38.             string s;
  39.             for (auto str : arr)
  40.             {
  41.                 s += str;
  42.             }
  43.         }
  44.     }
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement