#pragma once

extern "C" {

/**
 * @brief Perform CPU-intensive work for benchmarking and health check purposes.
 *
 * This function performs a deterministic amount of CPU work that cannot be
 * optimized away by the compiler. It's used both in the health check resolve
 * stage and in benchmarks to measure the actual CPU time consumed.
 *
 * @param iterations Number of loop iterations to perform
 */
void spend_cpu_cycles(int iterations);
}

/**
 * @brief Default CPU work iterations for health check benchmarking.
 *
 * Represents the number of CPU-intensive loop iterations used in the
 * /ok health check resolve stage. This value provides 650ns of CPU work
 * and achieves 1M requests/second throughput through the 4-stage pipeline.
 */
constexpr int DEFAULT_HEALTH_CHECK_ITERATIONS = 4000;
