.Net Timer

1 System.Timers.Timer   

      The Elapsed event is raised on a ThreadPool thread. If the processing of the Elapsed event lasts longer than Interval, the event might be raised again on another ThreadPool thread. Thus, the event handler should be reentrant.

2 System.Thread.Timer      

      The method specified for callback should be reentrant, because it is called on ThreadPool threads. The method can be executed simultaneously on two thread pool threads if the timer interval is less than the time required to execute the method, or if all thread pool threads are in use and the method is queued multiple times.

3 System.windows.Timer

      It is based on UI Thread.When process elapsed event,UI(winform) will lose response.

posted on 2009-05-15 17:15  -foman-  阅读(323)  评论(0编辑  收藏  举报

导航