On 2/14/07 8:42 PM, [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote:

> I am writing a class that needs to run a method at a given interval
> on its own.  It is not critical that the timing be precise, and at
> runtime, there could conceivably be thousands of instances of this
> class in operation simultaneously.  What is the best way to go about
> this?  Make the class a subclass of a timer?  Or perhaps a thread?
> It would be preferable if it would use as close to no processor power
> as possible.

How long will this method take for each iteration? Keep in mind that a timer
runs during idle time, and the program will become unresponsive while it is
running. If this takes fraction of a second, go that way. If it takes a
second or more, a thread is probably the better option.

__________________________________________________________________________
Kem Tekinay                                                 (212) 201-1465
MacTechnologies Consulting                              Fax (914) 242-7294
http://www.mactechnologies.com                        Pager (917) 491-5546

  To join the MacTechnologies Consulting mailing list, send an e-mail to:
           [EMAIL PROTECTED]








_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to