Hello
Using
Java, I have spent a lot of time trying to make the sleep(long milli, int nano) method to work. My main purpose is to try and control the CPU usage at different percentage levels.
I got this information from the link below under Threads, �A new form of the sleep() method is provided which allows for sleep times smaller than one millisecond.�
Link is:
http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#threads Is it the same sleep method as above? I tried using sleep( 0, 1 ) with Windows XP Pro where I am expecting a CPU usage at or near 100% but its going only at 2%. When I change to sleep( 0 , 0 ) the CPU usage is at 100%.
I am using JBuilder Enterprise and Foundation with JDK 1.5.
If its not possible to make the sleep method work properly, is there another way to do it in Java?
Thanks for your help.