On Wed Sep 30, 2026 at 3:55 PM UTC, Christian Schulte wrote:
> Hi @misc,
>
> is there a way to manually set the "CPU clock frequency" to some
> arbitrary software value, like 1MHz for testing? I am searching for a
> way to test an application when run with a very limited system and would
> like to just simulate such a system in software. Something like: "Make
> the whole system (scheduler etc.) run as if the CPU is clocked with a
> given frequency (that could be kHz, MHz - values not supported by the
> hardware). Something like:
>
> update boot.conf to set said clock to say 500kHz
> reboot
>
> System runs with that 500kHz on next reboot.
>
> Regards,

Hi Christian,

As far as I know that is not possible. However, you can sysctl
hw.perfpolicy=manual and then sysctl hw.setperf=0-100.

You can see what clock speed you got with sysctl hw.cpuspeed.

I think this is largely a hardware support thing and you'll have a range
of supported speeds. Like you might have 800MHz, 1200MHz, 1800MHz, and
finally 2200MHz.

Sincerely,

Henrich

PS: If you want to test something really, really slow, use qemu without
any acceleration.

Reply via email to