Example #1
0
        private void CompositionTarget_Rendering(object sender, EventArgs e)
        {
            TimeSpan currentRenderingTime = (e as RenderingEventArgs).RenderingTime;

            if (currentRenderingTime.Ticks == LastRenderingTime.Ticks)
            {
                return;
            }

            FrameProcessor.UpdateFrame((currentRenderingTime - LastRenderingTime).TotalSeconds);
            LastRenderingTime = currentRenderingTime;
        }
Example #2
0
        private void CompositionTarget_Rendering(object sender, EventArgs e)
        {
            TimeSpan currentRenderingTime = (e as RenderingEventArgs).RenderingTime;

            if (currentRenderingTime.Ticks == LastRenderingTime.Ticks)
            {
                return;
            }

            try
            {
                FrameProcessor.UpdateFrame((currentRenderingTime - LastRenderingTime).TotalSeconds);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"{ex.StackTrace}", $"{ex.Message}");
            }

            LastRenderingTime = currentRenderingTime;
        }