Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <chrono>
- #include <thread>
- #include <iostream>
- using namespace std;
- int main()
- {
- int*** tab = new int**[3840];
- for(auto i = 0U; i < 3840; ++i)
- {
- tab[i] = new int*[2160];
- for(auto j = 0U; j < 2160; ++j)
- tab[i][j] = new int[3];
- }
- long long int time_mean = 0;
- for(auto iter = 0U; iter < 1000; ++iter)
- {
- auto t = chrono::high_resolution_clock::now();
- for (auto i = 0U; i < 3840; ++i)
- for(auto j = 0U; j < 2160; ++j)
- for(auto k = 0U; k < 3; ++k)
- ++tab[i][j][k];
- auto t2 = chrono::high_resolution_clock::now();
- time_mean += chrono::duration_cast<chrono::milliseconds>(t2 - t).count();
- }
- cout << "Time: " << time_mean / 1000.0 << endl;
- std::this_thread::sleep_for(std::chrono::seconds(10));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment