Skip to content

Conversation

@Screwtapello
Copy link

I wanted to run an old video-game that used a busy-wait for proper timing, but I didn't want to spend gigahertz on a process designed for megahertz. I found your cpulimit tool, and it was almost what I wanted: it slowed things down nicely, but the default chunk-size of 100ms was too much. I could visibly see the game run a little bit, then pause, then run a little bit and pause again.

With this patch, I'm running my game with a chunk-size of 16ms, or about one frame at my monitor's 60Hz refresh rate, and it works beautifully.

With a large chunk-size, the cpulimit command adds very little overhead,
but the CPU usage of the limited process may vary wildly from moment to moment.

With a small chunk-size, the cpulimit command can add significant overhead,
but the CPU usage of the limited process stays very close to the requested
value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant