Countdown with less updates

Heyyy to all Gliders!

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:

  1. is there a smarter way to implement the timer?
  2. 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…?
  3. 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.

Sooo thankful for any help!

Nina

Wow. Does the date difference column cause an update every minute? That doesn’t seem right. Might want to use a math column instead to test.

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.

2 Likes

The Math column doesn’t use updates.

3 Likes

Thanks @Jeff_Hager

Apparently it doesn’t count as an update. :slight_smile:

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?

This :point_up_2:

Create an IF column that returns either the math column or zero.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.