Skip to content

Commit

Permalink
Caution with execute / execute_once when dealing with time
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreDecan committed Aug 16, 2018
1 parent 38ce293 commit cd02e0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Similarly, ``idle(x)`` evaluates to ``True`` if no transition was triggered duri
These two predicates rely on the :py:attr:`~sismic.interpreter.Interpreter.time` attribute of an interpreter.
The value of that attribute is computed at the beginning of each executed step based on a clock.

.. note::

The interpreter's time is set by the clock each time :py:meth:`~sismic.interpreter.Interpreter.execute_once` is called.
Consequently, a call to :py:meth:`~sismic.interpreter.Interpreter.execute` (that repeatedly calls :py:meth:`~sismic.interpreter.Interpreter.execute_once`) could lead to macro steps with different time values, depending on the duration required to process the underlying calls to :py:meth:`~sismic.interpreter.Interpreter.execute_once`.


Interpreter clock
=================

Expand Down Expand Up @@ -377,4 +383,4 @@ the last executed step.

.. testoutput:: delayed

Current floor: 2
Current floor: 2

0 comments on commit cd02e0d

Please sign in to comment.