更新自定义进度条时应该有多少 FPS?

发布于 2024-09-02 08:02:51 字数 74 浏览 1 评论 0原文

我刚刚编写了一个自定义进度条,它是单缓冲的并且将保持如此。对于这样的事情每秒需要多少帧?我不想浪费太多的 CPU 来不必要地更新屏幕。

I just wrote a custom progress bar, it's single buffered and will remain so. How many frames per second are desirable for something like this? I don't want to waste too much CPU updating the screen unnecessarily.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

平安喜乐 2024-09-09 08:02:51

根据经验,对于非常小、简单的运动动画来说,10 fps 是合理的最小值。对于更复杂的运动和/或更大的场景,最低帧速率为 30 fps。

然而,一般来说,进度条在帧与帧之间变化很小。如果您使用的是非常简单的动画,您可能会发现低于 10fps 的效果。

我建议从 10fps 开始并检查结果。从那里调。

As a rule of thumb, 10 fps is a reasonable minimum for very small, simple animations with motion. 30 fps is a minimum for more complex motion and/or larger scenes.

However, generally progress bars have very little change from frame to frame. If you are using a very simple animation, you may find that less than 10fps works.

I suggest starting at 10fps and checking the result. Tune from there.

千年*琉璃梦 2024-09-09 08:02:51

您可能想反其道而行之,只要有一个像素要更新,就更新进度条。如果您有一个 200 像素的条,则在每完成 0.5% 的处理时更新它。对于 1 分钟的过程,每 300 毫秒一次;对于 15 分钟的过程,每 4.5 秒一次。正如示例所示,FPS 通常会比平滑大动作动画所需的速度慢;否则,您就不需要进度条。根据您的设计,让进程在每次完成 x% 时向进度栏宣布可能比让进度栏每 n 毫秒检查进程更容易。

You might want to go the other way around and update the progress bar whenever there is a pixel of bar to update. If you have a 200 pixel bar, then update it when each 0.5% of the processing is completed. That’s every 300 ms for a 1 minute process but every 4.5 s for a 15 min process. As the examples indicate, the fps will generally be slower than you’d need for smooth large-motion animation; otherwise, you wouldn’t need a progress bar. Depending on your design, it may be easier to have the process announce to the progress bar each time it completes x% than to have the progress bar keep checking process every n ms.

段念尘 2024-09-09 08:02:51

出于功能目的,我很高兴每秒或两次进行更新。

如果你想让它看起来不错的话,10-20 fps。

I'd be happy with an update per second or two for functional purposes.

10-20 fps if you want it to look good.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文