public interface Timer
Constellation.getTimer()
or Constellation.getTimer(String, String, String)
. Of particular
interest is the so-called "overall timer", to be accessed by Constellation.getOverallTimer()
, and to be started when
the application starts and stopped when the application finishes.
A Timer records various times, such as queued, submitted, start, stop (similar to openCL events), but usually only start and
stop are used. Each timer event also has associated with it a device name (for instance "java" or "gtx480"), a thread name
(usually the executor identifier), and an action name, for instance "initialize" or "process".
Constellation uses some properties to control the behavior of the timers. The ConstellationProperties.PROFILE
property
controls the timing. When the ConstellationProperties.PROFILE_ACTIVITY
is set timings will be provided for, a.o., the
invocations of Activity.initialize(ibis.constellation.Constellation)
and Activity.process(ibis.constellation.Constellation, ibis.constellation.Event)
. In the end, the timing events will be written
to a file specified with the ConstellationProperties.PROFILE_OUTPUT
property, or to System.out
.Modifier and Type | Method and Description |
---|---|
void |
add(long start,
long end)
Adds a completed event to the Timer.
|
void |
add(java.lang.String device,
java.lang.String thread,
java.lang.String action,
long queued,
long submitted,
long start,
long end)
Adds a completed event to the Timer.
|
double |
averageTimeVal()
Returns the average time recorded for events in this Timer, in microseconds.
|
int |
nrTimes()
Returns the number of events recorded for this Timer.
|
int |
start()
Starts a timer event.
|
void |
stop(int eventNo)
Stops a timer event.
|
double |
totalTimeVal()
Returns the total time recorded for events in this Timer, in microseconds.
|
int start()
void stop(int eventNo)
eventNo
- the event number.void add(java.lang.String device, java.lang.String thread, java.lang.String action, long queued, long submitted, long start, long end)
System.nanoTime()
.device
- the device namethread
- the thread nameaction
- the action namequeued
- time when event was queued, in nanosecondssubmitted
- time when event was submitted, in nanosecondsstart
- time when event was started, in nanosecondsend
- time when event finished, in nanosecondsvoid add(long start, long end)
System.nanoTime()
.
This version has no separate queued or submitted time. These are assumed to be equal to the start time. The device, thread
and action names are taken from the timer itself.start
- time when event was started, in nanosecondsend
- time when event finished, in nanosecondsint nrTimes()
double totalTimeVal()
double averageTimeVal()