locked
Difference between two SYSTEMTIME structures RRS feed

  • Question

  • Hi,

    In my project, i need to find the difference between two SYSTEMTIME structure on Windows CE platform.

    Is there any way to achieve this?

    Thursday, September 30, 2010 8:57 AM

Answers

  • The easiest way is to use ::SystemTimeToFileTime() on both structures. Then subtract the two FILETIME structures. That will give you the number of 100-nano second intervals between the two times.

    Also, see: http://blogs.msdn.com/b/oldnewthing/archive/2004/08/25/220195.aspx

    -PaulH

    • Proposed as answer by Pavel Gnatyuk Friday, October 1, 2010 4:00 PM
    • Marked as answer by warrentang Tuesday, October 5, 2010 7:08 AM
    Thursday, September 30, 2010 4:05 PM

All replies

  • The easiest way is to use ::SystemTimeToFileTime() on both structures. Then subtract the two FILETIME structures. That will give you the number of 100-nano second intervals between the two times.

    Also, see: http://blogs.msdn.com/b/oldnewthing/archive/2004/08/25/220195.aspx

    -PaulH

    • Proposed as answer by Pavel Gnatyuk Friday, October 1, 2010 4:00 PM
    • Marked as answer by warrentang Tuesday, October 5, 2010 7:08 AM
    Thursday, September 30, 2010 4:05 PM
  • Thanks Paul. The SystemTimeToFileTime(), coupled with QuadPart worked.
    Tuesday, October 12, 2010 5:08 AM