Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make each timeout interval depend on the timestamp itself #181

Open
mitar opened this issue Apr 21, 2014 · 1 comment
Open

Make each timeout interval depend on the timestamp itself #181

mitar opened this issue Apr 21, 2014 · 1 comment

Comments

@mitar
Copy link

mitar commented Apr 21, 2014

Currently this plugin creates many timeout intervals, but all of them work at exactly the same period. This is suboptimal. Much better would be that depending on the current timestamp a next update interval would be computed. For example, if it is displayed "1 hour ago" you know that for next hour you do not have to update at all. So you can create a timeout which will be called in an hour. I think this is much better than having one global timeout which goes all around and checks everything again and again (what others are proposing). It is much better to have timeouts for each timestamp, but just not call them with static period. Timeouts are effective then and it is left to the browser to call them when needed. The solution is just to tell the browser when exactly this will be.

I implemented something like this in the past and it worked great.

@rmm5t
Copy link
Owner

rmm5t commented Dec 24, 2014

This is a reasonable suggestion, and I agree that the suggestions from others for a global timeout isn't a huge performance improvement, but there are some potentially nice side effects and some elegance in simplicity of using a global timeout. This probably isn't something that I'll look into until a Timeago 2 rewrite happens (it's in my head, but not planned anytime soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants