avengerx / LeadershipTwinTurboWheelFFBDriver

Force Feedback driver for Leadership Gamer Twin Turbo Steering Wheel (model 1021)
GNU General Public License v3.0
2 stars 0 forks source link

Use `GetSystemTimeAsFileTime()` instead of `GetTickCount()` to infer time references #12

Open avengerx opened 1 year ago

avengerx commented 1 year ago

The GetTickCount() function has the risk of overlapping every 49 days. Alternatively there's GetTickCount64(), yet GetSystemTimeAsFileTime() should be much lighter to the driver, if feasible to replace the current time reference.

It basically is used to determine time differences for the duration of effects run.

avengerx commented 1 year ago

It looks like relying on rdtsc() would be even faster.

As it amounts to CPU clock ticks since last reset, it may be difficult to approximate to actual milliseconds or any other wallclock variation.