Right. Thanks Richard! But I have to do something in my bean, wait for some time, and 
then do something else. The time spent waiting should be exact. What in this case?

"Richard S.Martin" wrote:

> The spec explicitly says you cannot: stop, start, suspend or resume. It does
> *not* say you cannot sleep a Thread. If the spec authors didn't want you to
> sleep a thread they would have put it in the list, therefore you can. Simple.
>
> Having said that. I find it hard to think of any reasons why you would want
> to. The original poster was talking about using it to emulate a long method
> call; well sleep wont emulate that very well since it will be idle. If you
> are trying to emulate a long method call, your delaying method should be
> active as well. Otherwise your profiling results will be [screwed | skewed]
> because other threads running will get more time.
>
> for(long end = System.currentTimeMillis() + DELAY; end >
> System.currentTimeMillis();)
>
> The only exception to this is if you are trying to emulate a remote call; in
> this case you should write a stub for your remote object and put the busy
> delay in there. This way you are still emulating the marshalling and network
> overhead involved.
>
> Rich

--
 "Bad times have a scientific value. These are the occasions a good learner would not 
miss"
--Ralph Waldo Emerson


*********************************************************
Disclaimer

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to