THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2012 at 05:49, xxxxxxxx wrote:
Originally posted by xxxxxxxx
<ADDRESS>
User Information:
Cinema 4D Version: R12/R13
Platform: Windows ; Mac ;
Mac OSX ;
Language(s) :
C++ ;
---------
</ADDRESS> The GeGetTimer() function currently returns the internal current timer count in milliseconds as a LONG value.
Does this counter value wraps after 2^31-1 to zero (like a formal LONG) or after 2^32-1 (like an ULONG)?
In the first case: May negative values be occured ?
My assumtion is, that the return value of GeGetTimer() should be an ULONG.
Has anyone experience in that ?
Andre
It wraps after 2^31 -1 (as LONG is suggesting) and then the return value can get negative.
In other words: As long as your startTime and endTime value are within 2^31 - 1 ms (roughly 25 days), the resulting difference will be definite and positive.
If the period you're measuring can be longer than those 25 days, then you could try to count the number of wrap-arounds and reset the counters (but that isn't 100% fool-proof, as there is no guarantee that the measuring thread has been executed within these 25 days).
If you really need to monitor a long period of time (which exceeds the range of GeGetTimer), using GetDateTimeNow() might be an option.
Best regards,
Wilfried