Exemple #1
0
        private UInt64 GetTickCount64Ex()
        {
            UInt64 realTime  = SpeedHook.GetTickCount();
            UInt64 tickCount = unchecked ((UInt64)(SpeedHook.timeGetTime()));

            // Initialize
            if (StoredTickCount64RealTime == 0)
            {
                this.StoredTickCount64RealTime = realTime;
                this.StoredTickCount64FakeTime = tickCount;
            }

            UInt64 fakeTime = this.StoredTickCount64FakeTime + (UInt64)((realTime - this.StoredTickCount64RealTime) * SpeedUp);

            this.StoredTickCount64RealTime = realTime;
            this.StoredTickCount64FakeTime = fakeTime;

            return(realTime);
        }
Exemple #2
0
        private Boolean QueryPerformanceCounterEx(out Int64 fakeTime)
        {
            Boolean result;
            Int64   realTime  = 0;
            Int32   tickCount = SpeedHook.timeGetTime();

            result = SpeedHook.QueryPerformanceCounter(out realTime);

            // Initialize
            if (StoredPerformanceCounterRealTime == 0)
            {
                this.StoredPerformanceCounterRealTime = realTime;
                this.StoredPerformanceCounterFakeTime = tickCount;
            }

            fakeTime = this.StoredPerformanceCounterFakeTime + (Int64)((realTime - this.StoredPerformanceCounterRealTime) * SpeedUp);

            this.StoredPerformanceCounterRealTime = realTime;
            this.StoredPerformanceCounterFakeTime = fakeTime;

            return(result);
        }