"""CPU hog: a busy loop that keeps one core at 100 %. Expected alert: 🔥 перегрузка after about a minute.""" import time print("cpu hog: spinning", flush=True) deadline = time.monotonic() while True: x = 0 for i in range(10_000_000): x += i * i if time.monotonic() - deadline > 60: print(f"cpu hog: still spinning, x={x % 1000}", flush=True) deadline = time.monotonic()