question

Alfacom-3008 avatar image
0 Votes"
Alfacom-3008 asked XiaopoYang-MSFT commented

MSDN Forum: Why GetTickcount returns 0 in C ++

In Windows Server 2016 standard edition
I am running the developed program (C ++).
I'm using GetTickCount every 30 seconds to get the TickCount value.

① 30 seconds after receiving "2684348122" ms
I got "0" ms when using GetTickCount
Why is this?
Originally, it counts up to 49.7 days, and it is a recognition that you can return that value.

② Continuing from ① above, but when I did GetTickCount again
"30000" ms → 30 seconds later, I got the perfect value for "60000" ms.
Normally, I think it is normal to get a value such as "Example: 30102" ms.
Why are you returning the right value?

windows-apic++windows-server-2016
· 22
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Did you also consider using GetTickCount64 instead of GetTickCount? You must adjust your variables and logging functions.

The problem with GetTickCount seems difficult to reproduce because you must wait 50 days without restarting the system. And, in your tests, it did not always happen. To check your programs, you can try the “Application Verifier” tool (https://social.msdn.microsoft.com/Forums/en-US/f5bbb778-6f0d-4d76-9d41-c56f00d7f8ee), which simulates the wraps. (Also make sure that the observed behaviour was not caused by a tool like Application Verifier, started by someone).

1 Vote 1 ·

Could you please show a minimal, reproducible sample without private information?

0 Votes 0 ·

Thank you

I can't show you the source code
It is possible to show the log.
Is there any problem with the log?

0 Votes 0 ·

Only GetTickcount part which produces the log is required. Also please show the log if possible.

0 Votes 0 ·
Show more comments

0 Answers