title: How to find the elapsed time between send and receive data?
body: <p>I am using the System.Timers.Timer class. And I enable when I send a message and disable when I receive the message. How do I calculate how much time has elapsed. I have set the interval as 1 sec </p>
  
  <p>Basically I retransmit data after 1000 sec again if I do not  recive an ACK. I retransmit 5 times max until I get a Ack. If I receive and something before 150ms then I stop retrnsmission. </p>
  
  <p>Here's the code:</p>
  
  <pre><code>timer1.interval = 1000;
  port.Write(data)
  timer1.enabled = true;
  </code></pre>
  
  <p>event handler for the received data.</p>
  
  <pre><code>timer1.enabled=false;
  </code></pre>