Fastest way to test if N milliseconds is elapsed from some event
<p>I'm writing udp multicast datagrams receiver.</p>

<p>If I receive datagram with number X and datagram "X-1" still not received I should wait for 5 ms (because UDP doesn't garantee order of packets) and if datagram "X-1" still not received I should recover.</p>

<p>How to do that? I want to store for each received packet in array the "timestamp" when packet is received. later I want to compare current time with timestamp, and if difference is more than 5 ms and packet X-1 is missing I should recover.</p>

<p>Probably you can suggest another algorithm?</p>

<p>Or if mine is fine how can I convert "current time" to "int" or "long" milliseconds? I don't want to use <code>DateTime.Now</code> object because it contains a lot of garbage I don't need and I need to do this processing several thousands times per second.</p>
