Pier is correct in his advise. My practical experience is to use "while(
true)" rather than an infinite "for" loop. I have found using the "for"
loop gives inconsistent (or worse) results.
Cheers!
Mark
----- Original Message -----
From: "Pier Fumagalli" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2001 7:11 PM
Subject: Re: plz guid me..which one is efficient...
> On Saturday, September 29, 2001, at 11:37 am, mayank p bhatt wrote:
>
> > Dear Sir,
> > I have very important question
> > which one is more efficient when I want to run infinite loom
> > while(true)
> > {.................}
> > OR
> > for(;;)
> > {.................}
> > or any other suggestion,
> > because I am using infinite loop many times in my program,
> > I have tried to calculate time for executing same thing for both,
> > but result are inconsistent,
> > plz tell me,
> > regards,
> > Mayank Bhatt
> >
>
> I believe that at the end the two statements are compiled down to
> the same set of Java bytecode instructions... You might want to use
> a Java disassembler to see how those work...
>
> Pier
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html