title: How do I reduce interface lag in C#?
body: <p>I have a problem with interface lag in C#.</p>
  
  <p>Since I'm still learning please be patient whilst I explain.</p>
  
  <p>I have narrowed the problem to my timer object.</p>
  
  <p>Basically my program queries a device through TCP/IP socket and outputs it to a textbox on screen.</p>
  
  <p>Now I am polling the device for data every second which requires some logic to be buried within timer object and the following is what happens between ticks:</p>
  
  <ol>
  <li>Increment a value.</li>
  <li>Construct the 2 strings that represents the command to be sent to
  the box (encapsulated in a function</li>
  <li>Encode the command</li>
  <li>Send command</li>
  <li>Clear the byte array</li>
  <li>Receive reply.</li>
  </ol>
  
  <p>Could this be too much processing being done in the event handler? Every time I try to move the window during the polling session i.e. when the timer is running I get a very bad input lag.</p>