One way might be to set up a PIT or DMA timer with the appropriate resolution (.01 or .001 secs) and use it to increment a count. Next, update the system time via NTP and record the result after calling
Code: Select all
time(NULLL)
A second way might be to modify the GetNTPTime function which appears to get (but not report) the fractional seconds. Modify it to also report the fractional seconds and store both 32 bit Secs and FractionalSecs variables in a struct. Scale the FractionalSecs to the tick count ISR resolution. Then, in the ISR (PIT or DMA timer) increment the scaled FractionalSecs, and, when needed the Secs. This would be a closer analog to the NTP scheme...
Thoughts? Hard to believe this hasn't been done before. If anyone has utilities to do this and to read/print the results, I'd be interested.
Thanks!