Subtracting times - need a result including milliseconds
-
Hello, I have 2 times which I would like to subtract. One time is a time that consists of hours, minutes, seconds and milliseconds. For instance 12:24:59.0. and the other time is a timer which consists only of milliseconds, seconds and minutes (no hours). For instance: 4.52.300. The problem is that I need to subtract the two times and get a result which also contains the difference in milliseconds (this is critical for the timer). I tried converting both times to COleDateTime, then subtracting them but I don't get the result in Milliseconds, so I lose information. By the way, I have both times in SYSTEMTIME format but is there a function that subtracts them? Any other ideas?
-
Hello, I have 2 times which I would like to subtract. One time is a time that consists of hours, minutes, seconds and milliseconds. For instance 12:24:59.0. and the other time is a timer which consists only of milliseconds, seconds and minutes (no hours). For instance: 4.52.300. The problem is that I need to subtract the two times and get a result which also contains the difference in milliseconds (this is critical for the timer). I tried converting both times to COleDateTime, then subtracting them but I don't get the result in Milliseconds, so I lose information. By the way, I have both times in SYSTEMTIME format but is there a function that subtracts them? Any other ideas?
SWDevil wrote:
By the way, I have both times in SYSTEMTIME format but is there a function that subtracts them?
Convert
SYSTEMTIME
toFILETIME
usingSystemTimeToFileTime
. ConvertFILETIME
toULARGE_INTEGER
and use it for artimetic operations.Prasad Notifier using ATL | Operator new[],delete[][^]