Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- mt19937 gen(55);
- void test(int razmer_vectorov_kotorie_anya_budet_peremnozhat) {
- vector<int> first(razmer_vectorov_kotorie_anya_budet_peremnozhat),
- second(razmer_vectorov_kotorie_anya_budet_peremnozhat);
- for (auto& el : first) {
- el = gen() % 10;
- }
- for (auto& el : second) {
- el = gen() % 10;
- }
- high_resolution_clock::time_point t1 = high_resolution_clock::now();
- // multiply(first, second);
- high_resolution_clock::time_point t2 = high_resolution_clock::now();
- duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
- std::cout << time_span.count() << '\n';
- }
- int main()
- {
- freopen("output.txt", "w", stdout);
- for (int i = 100; i < 100000; i += 100)
- test(i, gen);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement