in my code i use
Thread.currentThread().sleep(sleepTime);
in the main part (without the Thread object) of the code.
It seems to be working fine, but I'm worried there might be some kind of hidden trap that will later bite my ass.
Is there a better way to make your main process sit for a while? or is it a prescribed methodology?
EDIT:
In response to why I do this ...
I have a process that connects via HTTP or FTP to remote hosts and does things.
In other words...
material...
connect to remote ...
do things with a remote connection ...
close connection ...
more stuff ...
repeat if necessary.
, . , , .
, .
, , ...
...
...
MAIN ( )
a) "done"
b) , , , .
, , MAX_WAIT_TIME. , .
, ( ), while, , .
, ... - . , , , , , . , , ?