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