예제 #1
0
        public LoopThreadPool(int count, TimeSpan interval)
        {
            _pool = new LoopThread[count];

            for (int i = 0; i < count; i++)
            {
                _pool[i] = new LoopThread(interval);
            }
        }
예제 #2
0
        public static LoopThread Get(double frameRate)
        {
            if (_specificFrameRate.TryGetValue(frameRate, out LoopThread thread))
            {
                return(thread);
            }

            thread = new LoopThread(TimeSpan.FromMilliseconds(1000 / Math.Min(60, frameRate)));
            _specificFrameRate[frameRate] = thread;

            return(thread);
        }