private void txtRealtime_TextChanged(object sender, TextChangedEventArgs e)
        {
            TimeText timeText = new TimeText(txtRealtime.Text);

            lock (queuedText)
                queuedText.Enqueue(timeText);
        }
 void timer_Elapsed(object sender, ElapsedEventArgs e)
 {
     lock (queuedMousePositions)
         while (queuedMousePositions.Count > 0 && DateTime.Now - queuedMousePositions.Peek().Time > TimeSpan.FromMilliseconds(feedbackLoopDelay))
         {
             TimePoint timePoint = queuedMousePositions.Dequeue();
             Dispatcher.BeginInvoke((Action)(() => UpdatePosition(mouseDelayed, timePoint.Point)));
             if (timePoint.IsDown)
             {
                 Dispatcher.BeginInvoke((Action)(() => MouseDown(timePoint.Point, timePoint.IsHit)));
             }
         }
     lock (queuedText)
         while (queuedText.Count > 0 && DateTime.Now - queuedText.Peek().Time > TimeSpan.FromMilliseconds(feedbackLoopDelay))
         {
             TimeText timeText = queuedText.Dequeue();
             Dispatcher.BeginInvoke((Action)(() => UpdateText(timeText.Text)));
         }
 }