🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15837

Re: How to let the main application sleep ?

#15837
From: Tor Iver Wilhelmsen
Date: Thu, 22 Apr 1999 00:00
18 lines
959 bytes
Luigi Fonti <fonti@infn.it> writes:

> In a thread, you can use sleep(millisecs) or wait(millisecs) to suspend
> the activity.
> But, how can you force the main application to sleep for a given time ?

Well, the main() method is called from a thread.

> The compiler doesn't allow calling these methods in the main
> application: you can use them only in a trhead.

Well, everything in Java runs in threads.

Call

Thread.sleep();

with the required try-block around it.
Technical Details
Message-ID: <uyajkg9iq.fsf@sds.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <371F06EF.1C2628DE@infn.it>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,af16e2ac36663003
X-Google-Attributes: gidf74b3,public
From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no>
Subject: Re: How to let the main application sleep ?
Date: 1999/04/22
Message-ID: <uyajkg9iq.fsf@sds.no>
X-Deja-AN: 469514868
Sender: towi@SDSA1761
References: <371F06EF.1C2628DE@infn.it>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language