• программирование .net В ублюдочном ЯваСценарии всего две функции для таймеров (setTimeout, setInterval) а в няшном .NET для правильных пацанов есть 5 разных способов:

    • System.Threading.Timer
    • System.Windows.Forms.Timer
    • System.Timers.Timer
    • System.Windows.Threading.DispatcherTimer
    • System.Web.UI.Timer

    В документации к System.Timers.Timer цела страница оговорок типа
    The Timer component catches and suppresses all exceptions thrown by event handlers for the Elapsed event. This behavior is subject to change in future releases of the .NET Framework. Note, however, that this is not true of event handlers that execute asynchronously and include the await operator (in C#) or the Await operator (in Visual Basic). Exceptions thrown in these event handlers are propagated back to the calling thread, as the following example illustrates. For more information on exceptions thrown in asynchronous methods, see Exception Handling.
    ♡ recommended by @segfault

Replies (2)