Package io.perfmark
Class TaskCloseable
java.lang.Object
io.perfmark.TaskCloseable
- All Implemented Interfaces:
Closeable
,AutoCloseable
TaskCloseable is a helper class to simplify the closing of PerfMark tasks. It should be used in a
try-with-resources block so that PerfMark tasks are recorded even in the event of exceptions.
Implementation note: This would normally implement AutoCloseable
, but that is not
available in Java 6. A future version of PerfMark may implement the parent interface instead.
- Since:
- 0.23.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
TaskCloseable
private TaskCloseable()
-
-
Method Details
-
close
public void close()Stops the opened task. SeePerfMark.traceTask(String)
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-