Read the input token, if there is one, execute an (uninteresting)
computation to consume a specified amount of real time or to execute
it a fixed number of times, and produce
on the output the actual execution time (in milliseconds). Unlike the
Sleep actor, which suspends the calling thread for the specified
amount of time, this actor performs a computation during the
specified amount of time, thus consuming compute resources.
If <i>realTime</i> is true, then the number of computations it
performs is not fixed, but rather depends on what the thread
scheduler does. If it is false, then the amount of computation
done is fixed. The default is false.
Edward A. Lee
$Id: ExecutionTime.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 8.0
Yellow (eal)
Red (cxh)
The amount of time to consume. This is either in milliseconds,
if the realTime parameter is set to true, or in the number of
iterations of a fixed computation, if the realTime parameter
is set to false. This is a long
that defaults to 1000L.
The granularity of the computation. This parameter specifies
the number of additions performed in each invocation of the
(uninteresting) computation. This is a long, which defaults
to 400000, which yields a computation time granularity
of approximately 1msec on a MacBook Pro.
If true, then the executionTime parameter is
interpreted as milliseconds. If it is false (the default), then the
executionTime parameter is interpreted to specify the number
of cycles of a fixed computation. Use false to specify
a fixed computational load, and use true to specify an
amount of real time to consume. When this is true,
if the thread executing the fire() method is preempted
during its run, then less computation is done.