add more heavy task
All checks were successful
Global Runner Check / test-valgrind (push) Successful in 0s
Global Runner Check / test-linux (push) Successful in 0s
Infrastructure Stress Test / parallel-builds (1) (push) Successful in 14s
Infrastructure Stress Test / memory-analysis (push) Successful in 16s
Infrastructure Stress Test / parallel-builds (2) (push) Successful in 14s
Infrastructure Stress Test / parallel-builds (3) (push) Successful in 14s
Infrastructure Stress Test / parallel-builds (4) (push) Successful in 14s
Infrastructure Stress Test / parallel-builds (5) (push) Successful in 14s
Infrastructure Stress Test / parallel-builds (6) (push) Successful in 14s
Infrastructure Stress Test / parallel-builds (7) (push) Successful in 14s
Infrastructure Stress Test / parallel-builds (8) (push) Successful in 14s

This commit is contained in:
2026-02-09 23:43:53 +03:00
parent 9caac24301
commit bd2233f6b2

View File

@@ -1,24 +1,23 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <memory> #include <cmath>
#include <numeric> #include <thread>
#include <chrono>
void stress_test() {
std::cout << "Starting computational task..." << std::endl;
auto data = std::make_unique<std::vector<int>>(1000000);
std::iota(data->begin(), data->end(), 1);
long long sum = 0;
for (int i : *data) {
sum += i;
}
std::cout << "Sum calculated: " << sum << std::endl;
}
int main() { int main() {
stress_test(); std::cout << "Starting heavy task..." << std::endl;
auto start = std::chrono::high_resolution_clock::now();
double result = 0.0;
while (std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::high_resolution_clock::now() - start).count() < 10) {
for (int i = 0; i < 1000000; ++i) {
result += std::sin(i) * std::cos(i);
}
}
std::vector<int> dummy(10'000'000, 42);
std::cout << "Task finished. Result: " << result << std::endl;
return 0; return 0;
} }