is this really related to windows programming? ive never heard of EXPAT.
im no expert on timing with windows programming, but the way i would do it would be to set a timer and a global counter. ie:
thats surely a start.