Hi I'm writing an application that should have when the aplication start working, I'm using the function of C++ "GetTickCount()", the problem is that I read that this function has a 'BUG' that after '49.7' days the function return '0'.
So I'm trying to write a Custom function, I thoug the following solution, to use the 'GetTickCount()' function, rigth after the application start working and save the value in a variable, after that when I will need the function again, I'll check if the 'GetTickCount()' return 0, if yes that means that should use the value saved.
1. When using the function and the function return '0', I'll will loose all the time that pass until the last time
2. The function is use in a lot of places(different cpp files), so in the beggining a I thoug writting a class, but the problem is that every time that I will create the object I start the timer, for the specific object.
How I can do to create like a Global Object, that all the files in the application knows it.
GetTickCount from MSDN:
The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. It is limited to the resolution of the system timer. To obtain the system timer resolution, use the GetSystemTimeAdjustment function.
From The Web:
There was a load of noise last year about some air traffic control systems implemented on Windows NT (not sure if Embedded or not) which failed after running continuously for 49.7 days. Yup, they'd not allowed for rollover.
Thanks you for your help Thanks