title: What should I use to replace gettimeofday() on Windows?
body: <p>I'm writing a portable Socket class that supports timeouts for both sending and receiving... To implement these timeouts I'm using <code>select()</code>.... But, I sometimes need to know how long I was blocked inside <code>select()</code> which of course on Linux I would implement by calling <code>gettimeofday()</code> before and after I call <code>select()</code> and then using <code>timersub()</code> to calculate the delta...</p>
  
  <p>Given that <code>select()</code> on Windows accepts <code>struct timeval</code> for it's timeout, what method should I used to replace gettimeofday() on Windows?</p>