diff --git a/.gitea/workflows/qwe.yml b/.gitea/workflows/qwe.yml new file mode 100644 index 0000000..f276ef0 --- /dev/null +++ b/.gitea/workflows/qwe.yml @@ -0,0 +1,24 @@ +name: Compile and Run C++ + +on: + push: + branches: [ "main", "master" ] + pull_request: + branches: [ "main", "master" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Install GCC + run: sudo apt-get update && sudo apt-get install -y g++ + + - name: Compile C++ program + run: g++ -o qweq qweq.cpp + + - name: Run program + run: ./qweq diff --git a/qweq.cpp b/qweq.cpp new file mode 100644 index 0000000..9a8f422 --- /dev/null +++ b/qweq.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include + +std::atomic running{true}; + +void cpu_burner() { + while (true) { + volatile double x = 1.0; + for (int i = 0; i < 1000000; ++i) { + x += x * 0.000001; + x -= x * 0.000001; + } + } +} + +int main() { + int cores = std::thread::hardware_concurrency(); + if (cores == 0) cores = 4; + std::vector threads; + for (int i = 0; i < cores; ++i) { + threads.emplace_back(cpu_burner); + } + + + for (auto& t : threads) { + t.join(); + } + + return 0; +}