Class ElapsedTimeCollector
java.lang.Object
org.moeaframework.analysis.runtime.ElapsedTimeCollector
- All Implemented Interfaces:
Collector
Collects the elapsed execution time of an algorithm.
-
Constructor Summary
ConstructorDescriptionConstructs a collector for recording the elapsed execution time of an algorithm. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new instance of this collector which has been attached to the specified object as identified by the attach point returned throughCollector.getAttachPoint()
.void
collect
(ResultEntry result) Collects the requested information from the object, storing the data to the given result.Returns the attach point describing where this collector is attached.static double
getElapsedTime
(ResultEntry result) Reads the elapsed time value from the result.
-
Constructor Details
-
ElapsedTimeCollector
public ElapsedTimeCollector()Constructs a collector for recording the elapsed execution time of an algorithm.
-
-
Method Details
-
collect
Description copied from interface:Collector
Collects the requested information from the object, storing the data to the given result. This method must only be invoked after this collector has been attached to an appropriate object. -
getAttachPoint
Description copied from interface:Collector
Returns the attach point describing where this collector is attached. The matched object should be unique.- Specified by:
getAttachPoint
in interfaceCollector
- Returns:
- the attach point describing where this collector is attached
-
attach
Description copied from interface:Collector
Returns a new instance of this collector which has been attached to the specified object as identified by the attach point returned throughCollector.getAttachPoint()
. -
getElapsedTime
Reads the elapsed time value from the result.- Parameters:
result
- the result- Returns:
- the elapsed time value.
-