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

108
Views
Stop clock when page is not on screen

in the title I used a clock as an example but my question is for all functions. How do I stop some function when it is not on-screen. For the clock I used the useEffect Hook with setInterval(), since I am using ReactJs. So how do I stop the interval when the page is not visible on the screen so it does not slow down the users computer. I read that it is not possible to stop setInterval so I know that I need to clearInterval and and setInterval again.

about 4 years ago · Juan Pablo Isaza
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!