LightBulb uses too much CPU (~3%) and I know to fix this:
This small code in C++ can take up to 30% of the CPU:
int main() while (true) {/* some code */}
To fix that you can add a sleep function at the end of it like this:
int main() while (true) {/* some code */ Sleep(5);}
Now the program is limited to max. 200 cycles/second and will take up around 0.03% of the CPU.
I know that LightBulb is written in C# but please do a quick research.
Thanks!
Version
last
Details
LightBulb uses too much CPU (~3%) and I know to fix this:
This small code in C++ can take up to 30% of the CPU:
int main() while (true) {/* some code */}
To fix that you can add a sleep function at the end of it like this:
int main() while (true) {/* some code */ Sleep(5);}
Now the program is limited to max. 200 cycles/second and will take up around 0.03% of the CPU. I know that LightBulb is written in C# but please do a quick research. Thanks!Steps to reproduce