title: Ruby Sockets finding sent and received time for messages
body: <p>Is there a predefined function for the socket classes in ruby that will allow me to record the time messages are sent and received?</p>
  
  <p>At the moment I am sending or receiveing the message, and then recording the time immediately afterwards. While this is working I was wondering if anyone knew a better method?</p>
  
  <p>Here is how i do it at the moment. This is based off a ClientTCP class i had to write. The servers are laid out in a similar manner.</p>
  
  <pre><code>def send_mess
      @n.times do
          @client.print(@message)
          @sent_time_arr &lt;&lt; (Time.now.to_f)
  
          sleep(1/@freq)
  
      end
      @client.close
      return @sent_time_arr
  end
  </code></pre>
  
  <p>Any help you could provide would be greatly appreciated</p>