I need to do a simulation of a server on my local computer where the cpu is permanently loaded/utilized to an amount of about 80%.
Does anyone have an idea how i can manage to do that using Java?
I need to do a simulation of a server on my local computer where the cpu is permanently loaded/utilized to an amount of about 80%.
Does anyone have an idea how i can manage to do that using Java?
What you need is number of CPUs
threads that you let run in loops for 0.8 seconds, each second.
You can do that by using the Java threads and implementing the run() methods as while loops, checking the time constantly. every time they worked for 0.8 seconds, let them sleep for .2 seconds.