4
$\begingroup$

I want a dynamic timer to tell me how long it has been since a file update. I have coded a simple timer for this, but an hour or two in after completing an update, the dynamic timer stops responding and just reads "0 seconds since last update".

I think the same problem happens when using the Dynamic Clock example from Mathematica:

Dynamic[DateString[], UpdateInterval -> 1]

Initially, this clock works fine. But similar to my basic timer, after about an hour or two the time on the clock just stops updating. If I save the notebook running the dynamic clock code above, close the file and re-open the notebook, the clock shows the correct time and is ticking like it should.

Is there a way for the Dynamic clock to continually read the correct time without closing and re-opening the notebook file? I am currently using Mathematica 12.

$\endgroup$
  • 1
    $\begingroup$ Do you have to restart the notebook, as you write, or is it enough to reevaluate the cell with the Dynamic content in it? $\endgroup$ – C. E. Sep 28 at 9:27
  • $\begingroup$ Nah. Re-evaluating the cell just sets the time to the current time and does not update. I suspect that the cell continues to dynamically update the value, but that it just doesn't display the updated value in the notebook $\endgroup$ – user12572 Sep 28 at 19:51
  • 2
    $\begingroup$ Since this is very time consuming to try to reproduce, can you give us very precise and very specific steps to reproduce? Please also include SystemInformation["Small"]. $\endgroup$ – Szabolcs Oct 1 at 14:12
  • 1
    $\begingroup$ The instructions should start with restarting the front end. For example: 1. start the front end 2. open precisely one notebook 3. evaluate Dynamic[DateString[], UpdateInterval -> 1] 4. minimize Mathematica and do not touch it for 12 hours. Does the timer stop if you follow these precise steps? If you have other notebooks open, if you scroll the notebook, open the help browser, or interact with Mathematica in other ways, that could interfere with the process, so do not do that. Can you find a set of simple steps in this spirit that reproduces the issue? $\endgroup$ – Szabolcs Oct 1 at 14:43
  • 1
    $\begingroup$ It could be caused by some other interaction with Mathematica (in my opinion this is more likely a problem with Mathematica than interference from another program). $\endgroup$ – Szabolcs Oct 5 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.