🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #155

Timeout Class

#155
From: Alex Thomas
Date: Sat, 06 Sep 2003 17:58
17 lines
1477 bytes
I need to know how to write a class that is a simple thread to measure a
timeout period.  I should work something like this:

Timer T = new Timer(60000);

T.start();
veryImportantMethod();
T.stop();

If the veryImportantMethod method takes more than 60 seconds T will throw an
exception.

Can anyone help me out with this?



-Alex
Technical Details
Message-ID: <Nep6b.6152$_26.1842@newsread2.news.atl.earthlink.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!nntp.cs.ubc.ca!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,d83e75844c73ab1c,start
X-Google-Attributes: gid10d6db,public
X-Google-ArrivalTime: 2003-09-06 10:58:08 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!nntp.cs.ubc.ca!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!not-for-mail
From: "Alex Thomas" <alex.thomas@mindspring.com>
Newsgroups: aus.computers.java
Subject: Timeout Class
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <Nep6b.6152$_26.1842@newsread2.news.atl.earthlink.net>
Date: Sat, 06 Sep 2003 17:58:05 GMT
NNTP-Posting-Host: 66.245.78.215
X-Complaints-To: abuse@earthlink.net
X-Trace: newsread2.news.atl.earthlink.net 1062871085 66.245.78.215 (Sat, 06 Sep 2003 13:58:05 EDT)
NNTP-Posting-Date: Sat, 06 Sep 2003 13:58:05 EDT
Organization: EarthLink Inc. -- http://www.EarthLink.net