On minimizing the application JS timer not running
Application Type
Mobile

Hi!

I've written a JS code for displaying timer in DOM. When I minimize the application and comeback after few minutes the timer remains the same. For example, I'm minimizing the application at 9:30 and I open the application after a minute the application it starts running from 9:25.

Is there anything that I can do with this?

Hi Ajay,

You can use Javascript Timer using Web Worker (Async Function). Please use below link for the same -

https://abhi9bakshi.medium.com/why-javascript-timer-is-unreliable-and-how-can-you-fix-it-9ff5e6d34ee0

Thanks

Vinod


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.