
Sleep |
ptolemy.actor.lib.Sleep |
On each firing, read at most one token from each input channel, sleep
by the specified amount of real time, and then produce the same input
tokens on the respective output channels. This actor calls Thread.sleep()
in the fire() method, so the thread that calls fire() will be suspended.
If fire() is called multiple times in one iteration, sleep is only called
the first time.
If the width of the output port is less than that of the input port,
the tokens in the extra channels are lost.
The effect of this actor is different in different domains.
In domains where all actors are iterated from within a single director
thread (like SDF and DE), then multiple instances of this actor will
result in cumulative time delays. That is, the time taken by an iteration
of the model will be greater than the sum of the sleep times of all the
instances. In domains where actors execute in their own thread (like PN
and CSP), only the execution of the individual actor is slowed.
Note that another way to slow down the execution of a model while running
inside vergil is to turn on animation.
Author(s): Jie Liu, Christopher Hylands, Edward A. Lee
Version:$Id: Sleep.java,v 1.32 2006/03/29 20:32:06 cxh Exp $
Pt.Proposed Rating:Green (eal)
Pt.Accepted Rating:Yellow (cxh)
sleepTime
The sleep time in milliseconds. This has type long and default
"0L".