Exemple #1
0
        internal TimeFrame(ulong realTick, ulong logicTick)
        {
            this.realTick  = (long)realTick;
            this.logicTick = (long)logicTick;
            TimeTickCache.SetTimeNow();

            var currentFrame = TimeTick.NowReal.TimeStamp;

            nextFrame = currentFrame + this.realTick;
        }
Exemple #2
0
        internal void JoinFrame()
        {
            var currentFrame = TimeTick.NowReal.TimeStamp;

            if (nextFrame > currentFrame)
            {
                Thread.Sleep((int)(nextFrame - currentFrame));
            }

            TimeTickCache.TickTime(logicTick);

            nextFrame += realTick;
        }