I built a challenge app where the user can do different quests. The moment he is starting a quest, a timer shall run for 30 min and shows the user the remaining time. I implemented the timer using 3 columns
start_time (when user clicks on button START the current time is written into the column)
elapsed_time (glides “date difference” column with start_time - current time)
remaining_time (math column with time_limit - elapsed_time)
Three questions:
is there a smarter way to implement the timer?
With this solution, I get an update every minute → it’s just TOO many updates. How can I cut down on the number of updates…?
How can I stop the timer. At the moment, the elapsed_time and the remaining_time column don’t ever stop to calculate. It would be great to stop them after the time_limit is over.
I thinks that’s pretty similar to how I would do it.
This would surprise me if it was true. Do you actually see the update count increasing every minute? The date difference column should be nothing more than some simple math that occurs on the user’s device, so I see no reason for it to cause any updates, unless it’s being used to trigger another column to call an API or something like that.
I think you could use an IF column to check the duration and if it’s less than zero, just return zero.
Regarding the stopping. Can I somehow use an IF column and a MATH column at the same time? Or do I have to make a new IF column that references to the MATH column and either copies the value or returns zero?