Hi, we have the following problem:
We have a code that uses the "GetTickCount" method (the return value is the number of milliseconds that have elapsed since the system was started).
The Problem:
Since GetTickCount returns only a 32-bit number, after about 49 days, the counter wraps.
The solution we thoung is the following:
Use the "COleDateTime::GetCurrentTime", but the problem is that this method returns the value for example like: 9411.22222 (double variable)
and we need the value in DWORD so when we set the value in the variable we lost all the date after the '.', we will receive the value "9411".
Any Ideas?
How to resolve this?
Thanks :eek:
dev.cplusplus
0
Junior Poster in Training
Recommended Answers
Jump to PostYou could set up another variable that increments each time your value wraps. That effectively gives you a 64bit counter. This of course would require some minor redesign every time your counter is accessed in the code.
All 4 Replies
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
dev.cplusplus
0
Junior Poster in Training
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.