I am sampling a system over the UART port, and then logging the info in a file with a timestamp (including milliseconds). If I sample at 1 second intervals, the data comes
The .NET timers don't have infinite resolution. My experiments with .NET 3.5 and .NET 4.0 show that you can expect, at best, 15 ms resolution with the .NET timer objects. My experience has been that with a timer interval of 100 ms, you can expect a tick typically in the 100 to 105 ms range, but I've seen a range as wide as 99 to 120 ms.
For full details see http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=815.
If you need better accuracy, you can use the Windows timers directly. I created a wrapper for the Timer Queue API at http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=817.