Package gda.px.metrics
Class Metric
java.lang.Object
gda.px.metrics.Metric
-
Method Summary
Modifier and TypeMethodDescriptionstatic MetriccreateStarted(String name) Create a newMetricin a started state.static MetriccreateUnstarted(String name) Create a newMetricin an unstarted state, i.e.longReturns the elapsed time, in the specified unit.voidlog()Logs the recorded time for the action.voidstart()Starts timing an action.voidstop()Stops timing an action.
-
Method Details
-
createUnstarted
Create a newMetricin an unstarted state, i.e. its {#linkstart()method will need to be called for it to start timing an action.- Parameters:
name- name of the metric
-
createStarted
Create a newMetricin a started state.- Parameters:
name- name of the metric
-
start
public void start()Starts timing an action. -
stop
public void stop()Stops timing an action. -
elapsed
Returns the elapsed time, in the specified unit.- Returns:
- elapsed time
-
log
public void log()Logs the recorded time for the action.
-