Multiple timers on the page, how do you implement?

It is necessary to make multiple independent countdown timers, though the date of the end event is fetched from the database, tell me how this can be implemented, or maybe someone knows useful links on this subject. In addition you need to the expiry of the period occurred some action such as recording certain information in a DB, but as far as I know the timer is client side, ie when the page is not open, the timer is not working, and need to work always.
September 19th 19 at 00:10
4 answers
September 19th 19 at 00:12
It is sad to think that will be for the game on exit, if such ask.....
have you ever thought about what it all could be done for training purposes? - magdalena.Konopelski22 commented on September 19th 19 at 00:15
no! then you need to start with more simple that you can write on the basis of existing knowledge and able to Google, think of the result to apply... - Norene94 commented on September 19th 19 at 00:18
September 19th 19 at 00:14
need to expiration there is some action such as recording certain information in a DB

Why?
September 19th 19 at 00:16
It is used in games such.
> the date of the end event is fetched from the database
Query in the database we get the date, pass the JS from it or to it run the report

> at the end of the period was some action such as recording certain information in a DB
But this means that the timer should work on the server more and not just for JS because if the client closes the browser it resets.

In short look about the timers in browser-based games.
September 19th 19 at 00:18
On the server you will need cron or at.

Find more questions by tags PHPJavaScript