Re: Windows.Forms.Timer
От: Аноним  
Дата: 26.06.06 12:14
Оценка:
Из MSDN:

System.Threading.Timer is a simple, lightweight timer that uses callback methods and is served by threadpool threads. You might also consider System.Windows.Forms.Timer for use with Windows forms, and System.Timers.Timer for server-based timer functionality. These timers use events and have additional features.

Ну и:

Timers are lightweight objects that enable you to specify a delegate to be called at a specified time. A thread in the thread pool performs the wait operation.
Using the Timer class is straightforward. You create a Timer, passing a TimerCallback delegate to the callback method, an object representing state that will be passed to the callback, an initial raise time, and a time representing the period between callback invocations. To cancel a pending timer, call the Timer.Dispose function.
Note
There are two other timer classes. The System.Windows.Forms.Timer class is a control that works with visual designers and is meant to be used in user interface contexts; it raises events on the user interface thread. The System.Timers.Timer class derives from Component, so it can be used with visual designers; it also raises events, but it raises them on a ThreadPool thread. The System.Threading.Timer class makes callbacks on a ThreadPool thread and does not use the event model at all. It also provides a state object to the callback method, which the other timers do not. It is extremely lightweight.
SUNETA Мой блог


данное сообщение получено с www.gotdotnet.ru
ссылка на оригинальное сообщение
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.