Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- #if 0
- ofstream output_file("input.txt");
- for (int i = 0; i < 2000000; i++) {
- output_file << static_cast<char>('a' + rand() % 26);
- }
- #else
- ifstream input_file("input.txt");
- ofstream output_file("output.txt");
- string s;
- input_file >> s;
- string s2 = s;
- time_meter tm;
- ___CaesarEncryptOneThread___(&s2);
- const double one_thread_result = tm.seconds();
- tm.restart();
- CaesarEncrypt(&s);
- const double result = tm.seconds();
- const double x = result / one_thread_result;
- if (x > 0.75)
- output_file << "So sloooooow\n\n" << "time / time_one_thread = " << result << " " << one_thread_result << endl;
- else
- output_file << "\n\ncool nice\n\n" << result << " " << one_thread_result << endl;
- return 0;
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement