Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Time delay without Thread.sleep

807607Nov 27 2006 — edited Nov 27 2006
Hi everyone,

I have a Java3D application and in a such time i need a time delay I�m using the
Thread.sleep instruction, but when it's executed it pauses the current thread so the
modifications i intended to apply in the 3D environment do not work (it just works after the Thread.sleep ends). So, would be
possible to get a time delay without using the Thread.sleep instruction??

As alternative I�ve already tested the following code, but it doesn't work either.
java.util.Date start_time = new java.util.Date();
java.util.Date stop_time;
double etime=0;
for(;;){
	stop_time = new java.util.Date();
        etime = (stop_time.getTime() - start_time.getTime())/1000.;
        if((int)Math.ceil(etime)==5){
              break;
	}
Thanks since now.


�der.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2006
Added on Nov 27 2006
1 comment
405 views