Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

310
Views
Synchronizing a countdown timer through Firestore

Creating an app in Javascript in which I'm creating a timer that updates at every second and so, I want to store that timers time in firebase firestore at every update in timer so I could retrieve it with Onsnapshot on another page for displaying what would be an efficient way to do this because I don't think updating DOC every second will be a good approach

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Synchronizing each tick across the database is indeed not very efficient. But time has the nice trait that it passes (for the purpose of a use-case such as this) at the same rate on all clients. So what you'll want to do instead is store the start time and the interval of the timer in the database, and then have each client run its own local countdown based on that.

I wrote an example of this using the Firebase Realtime Database, so I recommend checking that out as a starting point: How to implement a distributed countdown timer in Firebase

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!