Timer not updating on real device

I added a timer on my car auction application. I want to display an end time for auction using timer. I made a custom function to calculate time between the current time and end time set in the database and display it on the homepage and details page.

Everything is working good in debug mode but when i install the application on a real device it is not updating in real time. Can you please help me with this?

I am adding videos for reference.

This is the timer in debug mode:

WhatsApp Video 2024-02-01 at 1.41.27 PM.mp4
2.42MB

and this is the timer on real device:

WhatsApp Video 2024-02-01 at 1.46.21 PM.mp4
2.75MB

I need to refresh the page everytime, i want to update automatically just like it does in debug mode.

3
2 replies