尝试确定C#WPF程序中的FPS

问题描述:

我正在使用WPF和C#为触摸表编写应用程序. (而且,我对WPF并不十分熟悉.)我们怀疑我们没有从API获得"所请求的帧率,所以我试图编写自己的FPS计算器.我知道基于内部时钟进行计算的数学方法,只是不知道如何在Windows/WPF API中访问计时器.

I'm writing an application for a touch table using WPF and C#. (And, I'm not terribly familiar with WPF. At all.) We suspect we're not getting the framerate we're "requesting" from the API so I'm trying to write my own FPS calculator. I'm aware of the math to calculate it based on the internal clock, I just don't know how to access a timer within the Windows/WPF API.

访问计时器需要什么库/命令?

What library/commands do I need to get access to a timer?

我认为您正在寻找

I think you're looking for the StopWatch. Just initialize it and reset it with each start of your iteration. At the end of an iteration, do your calculation.