java - design a test program: increase/decrease cpu usage -



java - design a test program: increase/decrease cpu usage -

i trying design , write java programme can increase/decrease cpu usage. here basic idea: write multi-thread program. , each thread float point calculation. increase/decrease cpu usage through adding/reducing threads.

i not sure kinds of float point operations best in test case. especially, gonna test vmware virtual machine.

you can sum reciprocals of natural numbers. since sum doesn't converge, compiler not dare optimize away. create sure result somehow used in end.

1/1 + 1/2 + 1/3 + 1/4 + 1/5 ...

this of course of study occupy floating point unit, not central processing unit. if approach or not main question should pose.

java design testing implementation

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -