Ejemplo n.º 1
0
            public FrameMonitor(ApplicationWorker worker)
            {
                listeners = ArrayPool <IFrameListener> .Shared.Rent(worker.FrameListener.Count);

                worker.FrameListener.CopyTo(listeners, 0);

                this.worker = worker;
                this.worker.frameDeltaStopwatch.Restart();
            }
Ejemplo n.º 2
0
            public WorkerMonitor(ApplicationWorker worker, TimeSpan targetFrameRate)
            {
                this.worker = worker;
                lock (this.worker.synchronizationObject)
                {
                    this.worker.targetFrameRate = targetFrameRate;
                    this.worker.Delta           = TimeSpan.Zero;
                }

                if (!this.worker.elapsedStopwatch.IsRunning)
                {
                    this.worker.elapsedStopwatch.Start();
                }
                this.worker.deltaStopwatch.Restart();
            }