🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Pausing / Delaying Program Execution Help?

#19164
From: Sterling Moses
Date: Fri, 27 Feb 1998 00:00
71 lines
2134 bytes
public void class Ars implements Runnable{
    public void run(){
      //  code to check mailbox and process it
    }
}

public void main(String args[]){
    Ars ars = new Ars();
    while(true){
        ars.start(); // starts the thread
        ars.sleep(10000); // puts it right to sleep
    }
}

I want to be able to sleep the checker thread. So I guess I should split the
checker up into another class, and have it launch the process thread? What
do you think.

Sterling.

Marc Jourdenais wrote in message <34F72510.CF08920C@pcn.com>...
>ARRGH.  I think I went temporarily brain-dead.   A little too quick on the
POST
>trigger.   I meant something like:
>
>while (true)
>{
> // check mailbox
> Thread.sleep(10000);
>}
>
>Sorry,
>Marc
>
>Marc Jourdenais wrote:
>
>> Sterling,
>>
>> Have you tried:
>>
>> while (Thread.sleep(10000))
>> {
>>  // check mailbox
>> }
>>
>>  - Marc
>>
>> Sterling Moses wrote:
>>
>> > I have a program which checks a POP3 box for email, when it sees there
is
>> > email waiting it parses this into a database.
>> >
>> > How can I suspend the program for a period of time and say have it
check
>> > every 10 seconds, and do this internal to the program.
>> >
>> > I tried to use Threads but I am not getting the results I would like,
but am
>> > also very new to java. I have a background in C/C++, but just new to
java.
>> >
>> > Any help, anything would be much appreciated.
>> >
>> > Post comments here, or send them directly to sterling@cecoh.com
>> >
>> > Sterling.
>
>
>
Technical Details
Message-ID: <6d7bqa$8ln5@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6d75od$8lp2@forums.borland.com> <34F7241A.4AA873FB@pcn.com> <34F72510.CF08920C@pcn.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,b2de1f6fa0118bb7
X-Google-Attributes: gidf74b3,public
From: "Sterling Moses" <sterling@cecoh.com>
Subject: Re: Pausing / Delaying Program Execution Help?
Date: 1998/02/27
Message-ID: <6d7bqa$8ln5@forums.borland.com>
X-Deja-AN: 329258093
References: <6d75od$8lp2@forums.borland.com> <34F7241A.4AA873FB@pcn.com> <34F72510.CF08920C@pcn.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: CECO Management Group
Newsgroups: borland.public.jbuilder.java.language