Now?

  • Thread starter Thread starter JoeM
  • Start date Start date
J

JoeM

What options are there for checking a laps of time? I'm working on an
implemention of a timeout function for a wireless connection. If a given
amount of time passes after a client sends a request to the server (ie, 5
seconds), I want the client to respond with a timed out message. Using and
checking NOW (with other logic for message handling) has me wondering about
its accuracy.

Is Now a precise function? Or is there a better method to check the pass of
time?

Joe
 
Precise like how precise? For 5 seconds, GetTickCount() should be fine.
It's resolution is 1ms and it's pretty accurate. Now is probably, since
it's based on GetSystemTime(), limited to a resolution of 1s. I wouldn't
think that this would be a problem for something like a network time-out.
You can always make the time-out a little longer...

Paul T.
 
Back
Top