Hi, I saw a lot of posts about this topic, but with no clear answer.
I read that the stopwatch is not able to calculate seconds by accurate and it “loses” about 10sec (so what is it purpose? That what stopwatch does).
I also saw a post of this guy that built a “memory cards game” that includes a timer that shows the user the elapsed time, from what I saw the timer is VERY accurate.
What is the CORRECT way to use a timer to achieve my goal?
I need my app to count TIME ELAPSED from one button click to second button click by the user.
Plus, I need the app to show the user the running timer.
For example, the user receives a task, and I would to know how much time has passed while doing the task.
what I was thinking of:
The user press “START” (starts the task)
The app goes to new tab with the timer.
The timer starts automatically.
When the task is finished, the user press “STOP” and go to other tab.
I’m not sure if a stopwatch is exactly what you want??? But first you need to understand how the glide stopwatch works. When you click on Start, it writes the current date timestamp to a column in your table. When you press pause, it takes the time you pressed the pause button, subtracts the start time, and writes that duration value into a duration column, and clears the start time column. If you press start again, it wites the current start time to the start time column but leaves the duration column as is. Pressing stop clears both the start time and the duration column.
Depending on how you intend to save the total duration, you may be saving the start time, a duration, and an end time, and doing some math to calculate a total duration from all three of those values.
Based on your explaination, you probably just want a custom action on the way into a screen that sets the current date time that you opened that screen. then when you click a button to leave that screen, you set another value with the current date time. It would necessarily be a realtime stopwatch, but the I think the start and end time would be fairly accurate.
Calculating duration is as simple as using a math column to subtract a start date time column from an end date time column.
you can manipulate the stopwatch with any component that has action… also you can customize the stopwatch’s look, size, and color… also hide its buttons… so I believe it is a great tool for your project…
unless you wanna do the countdown… then use some CSS clock and reverse transition