简体   繁体   English

在本地存储中保留一个计时器是个好主意吗?

[英]Is it a good idea to persist a timer in local storage?

Is it in any way bad to persist a constantly changing timer in the localstorage?在本地存储中保留一个不断变化的计时器有什么不好的吗?

Basically i have a timer and a function which looks at the count so every time a second passes the localstorage item is updated to the new one.基本上我有一个计时器和一个 function 来查看计数,因此每次经过一秒钟,本地存储项目都会更新为新项目。

It depends of the time rate, every second is ok, I have used this solution once and never had any problem, but if it's lower than 1s, you should find another solution.这取决于时间速率,每秒都可以,我用过一次这个解决方案,从来没有任何问题,但是如果它低于1s,你应该找到另一个解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM