倒计时时钟问题

发布于 2024-11-09 10:23:22 字数 357 浏览 0 评论 0原文

我正在使用基思·伍德(Keith Wood)制作一个很酷的倒计时时钟,我注意到一些异常行为,并希望看看是否有人可以解决它。看着倒计时了一会,时钟似乎暂停了。它似乎跟踪了正确的时间,但正如您将看到的,它似乎在几秒钟后暂停了一秒多。

如果您观看大约 30 秒,您将看到它

http://dl .dropbox.com/u/2982102/temp/countdownclock_052411/index.html

对此的任何帮助都会非常

感谢

I am using Keith Wood for a cool countdown clock and am noticing some off behavior and was looking to see if anyone could nail it. The clock seems to pause after watching it count down for a while. It seems to track the right time but as you will see it just seems to pause a more than a second after several seconds.

If you watch it for about 30 seconds you will see it

http://dl.dropbox.com/u/2982102/temp/countdownclock_052411/index.html

Any help on this would be huge

Thanks

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

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

发布评论

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

评论(3

逐鹿 2024-11-16 10:23:22

问题可能在于该插件似乎以 980 毫秒的间隔进行更新,大概是希望确保它每秒执行一次。当然,随着时间的推移,这个间隔将远离秒之间的界限,并且最终可能会跳过偶尔的一秒。

显而易见的解决方案是减少间隔(也许略小于 500 毫秒,这应该安全地确保 99.9% 的时间至少每秒执行一次)。这应该是安全的,尽管可能值得查看性能以确保它不会太费力。

The issue is perhaps that the plugin appears to update using an interval of 980ms, presumably with the hope of ensuring it will execute each second. Of course, over time this interval will drift far from the boundary between seconds and could end up skipping the occasional second.

The obvious solution is to decrease the interval (perhaps slightly less than 500ms which should safely ensure it is executed at least once per second 99.9% of the time). This should be safe, although it might be worth looking at the performance to ensure it isn't too taxing.

安稳善良 2024-11-16 10:23:22

我没看到你描述的内容。

然而,像这样的客户端代码,完全取决于用户的计算机配置和信息。因此,浏览器的性能可能会有很大差异。对于与此相关的任何问题,您无能为力。

某些数字图形似乎还没有完全加载,或者可能仍在“动态”加载。看看这个插件是否预加载图像可能是值得的。如果没有,您可能需要自己预加载它们。

I'm not seeing what you describe.

However, something like this, client-side code, depends totally on the user's computer configuration & browser, therefore, performance might vary greatly. For any issues related to this, there's not much you can do.

It also appears as if some of the graphics for the numbers are not fully loaded, or perhaps they are still loading "on the fly". It might be worthwhile to see if this plugin is pre-loading the images. If not, you may want to pre-load them yourself.

め七分饶幸 2024-11-16 10:23:22

它有时似乎运行得有点太快并开始超过正确的值。

暂停是指连续两次显示相同的值,第一个是超前的(即错误的),第二个是正确的。

It seems to sometimes run a little too fast and start to get ahead of the correct value.

The pause is when it's showing the same value for 2 consecutive ticks, the first being ahead (ie, wrong) and the second being correct.

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