🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to let the main application sleep ?

#15851
From: Andrew Bennett
Date: Thu, 22 Apr 1999 00:00
25 lines
1214 bytes

Luigi Fonti wrote:

> 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 ?
> The compiler doesn't allow calling these methods in the main
> application: you can use them only in a trhead.

I wouldn't recommend it, but I'll do psuedo code here.  Implementation
is up to you:

get system time
while (current time <= original time + desired sleep time)
// do nothing
endwhile


--
  Andrew Bennett
  abennett@cruzio.com

Note: I'm fairly busy in my personal life.  Private email to this
message may go un-noticed.
Technical Details
Message-ID: <37200535.DD0C0830@cruzio.com>
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: Andrew Bennett <abennett@cruzio.com>
Subject: Re: How to let the main application sleep ?
Date: 1999/04/22
Message-ID: <37200535.DD0C0830@cruzio.com>
X-Deja-AN: 469856921
Content-Transfer-Encoding: 7bit
References: <371F06EF.1C2628DE@infn.it>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language