Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to monitor current results with Dynamic

ls = {}; k = 1;

   AppendTo[ls, k++];
, UpdateInterval -> 10]]

For some reason output updates instantaneously and not every 10 seconds

share|improve this question
up vote 11 down vote accepted

When you edit ls, all dynamics that depend on ls will update instantly, this will cause ls to be edited which will update the dynamic which edits ls.... etc.

The way to avoid this is to specify that there should be no tracked symbols:

Dynamic[Refresh[AppendTo[ls, k++];
 Last@ls, UpdateInterval -> 10], TrackedSymbols -> {}]
share|improve this answer

TrackedSymbols is an option to Refresh, Manipulate, and related functions that specifies which symbols should trigger updates when their values are changed.

Dynamic[Refresh[AppendTo[ls, k++]; Last@ls, TrackedSymbols :> {}, UpdateInterval -> 1]]
share|improve this answer

UpdateInterval gives an upper bound to the dynamic updates. It doesn't turn off the automatic updating whenever a symbol that is being tracked gets updated.

Your code has AppendTo[ls, sth]. Imagine that as an equivalent of var=Append[ls, sth]; ls=var; where var is just a dummy to show that first Mathematica builds the list and then it assigns it to ls.

In var=Append[ls, sth], ls gets tracked. Then, ls gets changed with ls=var, triggering a self-update.

One possible solution is to make your dynamic NOT track changes in ls, as the other solutions suggested.

Dynamic[Refresh[AppendTo[ls, k++]; Last@ls, None], UpdateInterval -> 2]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.