My example did
not use a formula field
[Duration] = Seconds([Last Saved Time]).
If you choose to use and display such a field it will only hold a valid value when the timer is stopped,
My script set the
[Last Saved Time] through the API when the timer was stopped and your
[Duration] field will react to this change. However, you don't want to create a situation where a displayed value is different than the stored value. So all you have to do is reload the page when the timer is stopped and when the page refreshes the stored value of
[Duration] will once again be in sync with the displayed value of
[Duration]
This is a generic concern. If you are using the API to change a field's value you never want to get into a situation where the
displayed value is different than the
stored value or it will cause confusion to your users,