Timer thread has exited with code 259 (0x103) <p>I want to make a clock which display UTC and Local together. So, I used Timer class from System.Threading like below:</p> <pre><code>private static object _lockObj = new object(); static bool isDisplaying = false; public MainWindow() { InitializeComponent(); System.Threading.Timer _timer = _timer = new System.Threading.Timer(timer_expired, null, 0, 1000); } private void timer_expired(object state) { if(!isDisplaying) lock (_lockObj) { this.Dispatcher.BeginInvoke(new Action(() =&gt; { this.UTC_TIME.Text = DateTime.UtcNow.ToString("MMM-dd HH:mm:ss"); this.LOCAL_TIME.Text = DateTime.Now.ToString("MMM-dd HH:mm:ss"); })); isDisplaying = false; } } </code></pre> <p>But a few minutes later like 15 minutes or so, the clock stops. In a debug mode, I can see: </p> <pre><code>The thread 0x1e10 has exited with code 259 (0x103). </code></pre> <p>How can I run this clock works all the time?</p>