Exemplo n.º 1
0
        void RunTapThread()
        {
            int targetTickCount = Environment.TickCount;

            for (; ;)
            {
                viewModel.PollTap();
                int sleepAmount;
                unchecked
                {
                    targetTickCount += 5;
                    sleepAmount      = targetTickCount - Environment.TickCount;
                }
                if (sleepAmount > 0)
                {
                    Thread.Sleep(sleepAmount);
                }
            }
        }