# Timer formula : should need variables?

Hi there.
I’m struggling to find a timer formula to track time on actual tasks.
I would like to be able to track time when I check a task on.
But I can’t find a way to make a timer. I tried to use named formulas to increment a timer by using the same formula with a delta time (which I’m not sure is working) like :

But it doesn’t work as expected as I can’t see a timer, it just adds a random value.

I’m wondering if Coda doesn’t lack some variables possibilities, with getter and setters.
If there would be variables like this, I could set the variable to increment like : Time = Time + Delta Time

I’m also actually not sure of my delta time formula. I tried counting with odd and even, then made a formula like this (that seems to be ok, but please correct me if I’m wrong)

I’m ashamed, I wanted to find my own way to hack this, but it didn’t worked

1 Like

Tom- thinking out loud here, so bear with me!

Have you tried recording a start and end time, then calculating the difference? I suspect it will auto-update in this solution, but I’m imagining three columns:

• Tracking Time? (T/F)
• Last Start Time =if([Tracking Time?], Now(), [Last Start Time]) – as written, Now() will update automatically
• Last End Time =if(~[Tracking Time?], Now(), [Last End Time]) – same issue as above

Long-term, a leading-edge/trailing-edge function would be very powerful for this sort of use case: =leading_edge(TF_VAR) would be true for an instant as the checkbox flips from false to true, and false all other times. Trailing edge would be the opposite.

1 Like

Hey @chris_homburger ! Thanks, I never though to make the difference between start and end, and it is so obvious that I feel ashamed.
I’ll dig into what you showed, that’s interesting.

I managed to make a simple timer but can’t find a way to keep values to continue the timer when stopping it and keep the timer value when ending it.

1 Like

@tomavatars would you be willing to share your doc?

I can’t even seem to get it to display the Start Time without it constantly updating thanks to the Now() functionality.

What a fun thread! One way you can achieve this is using Coda’s builtin change tracking features which automatically track when something was created and updated, and also who made the change. Since Coda doesn’t have action buttons (things that you click which cause things to change), you’ll need to build this scenario using two checkboxes. One the tracks the start time, the other the end time.

This builds on the basics of:

• `Column.Modified()` to give you the timestamp when a column was updated (in our case a checkbox)
• Uses `Now()` to grab the ticking current time

Hope this helps,
Nigel.

2 Likes

Ahhh, using the Modified() function is the trick.

Is there any way to show the cumulative time that has passed?

Similar to the timer app on the iPhone, can you cumulatively time something, stopping intermittently where the time elapsed is ignored, and then restarting, only resetting when done? Any way to do that?

Is there no way to copy a value from one cell to another and not make the second cell dependent on the first?

Python has the list.copy() function that allows assignment of a list to a variable without assigning to the underlying list.

Is there no way to do something like that here?

I really feel like we need variables to do this properly.

There’s no support for actions currently so no easy way to support a pause/continue scenario. You could probably do it with multiple rows in a table, one row per time interval but that’s quite messy and would have a terrible interaction model.

I guess we could add a timer control at some point that would track start/stop/create states along with elapsed time.

What’s the actual Coda scenario you’re trying to model?

Nigel.

Don’t add that capacity on my account. I’m just playing with Coda and its capacities; there’s no real application.

However, it might be that some sort of variables would be useful for future applications - Idk

Love this exploration @cnr @chris_homburger @nigel @tomavatars ! I actually built out a template for tracking our meetings internally so we can compare actual start/end times of agenda items to the allotted time (complete with inline timer and shamer for people who go overbudget ). You can copy an example here. Also uses concept of dependencies to track progress through the meeting (each row is a meeting agenda topic and is marked as dependent on the previous item).

Let me know what you think!

Evan

3 Likes

LOVE the use of switch() here, @evan. That is the missing link that @tomavatars and I were searching for!

Thanks Evan!!
I’m sorry, this is a bit what I done on my doc and I didn’t took the time to share the screenshots here.
Would you like me to share a Sandbox doc for everyone on the community? This would be extremely fun!

Concerning the timer, as I want to use it as a tracker for tasks, I definitely need to store the value and start from the value stored to keep my tracker updating from the last state until a task is finished.

1 Like

Wow that’s so awesome! Love it

1 Like