Hey so I have 3 threads which have certain conditions when they print out something. this works fine. What I want to do now is make the thread just before it outputs something to send it to sleep for random amount of ms. I was thinking using the math class but not sure how.
the random() should generate random double greater than or equal to 0.0 and less than 1.0 right ?
will I just write something like
Thread.sleep(random());
^ that doesn’t work though tried it
Thread.sleep()takes alongvalue notdouble. You would need a typecast here: –