public class TimeClosable
extends java.lang.Object
implements java.lang.AutoCloseable
AutoCloseable
wrapper to allows timers to be closed automatically.
Its written to handle a null TimerService
Constructor and Description |
---|
TimeClosable(AppContext conn,
java.lang.String name)
Create with the default
TimerService
If no TimerService is enabled the TimeClosable
will have no effect. |
TimeClosable(AppContext conn,
java.util.function.Supplier<java.lang.String> name_supplier)
Create with the default
TimerService
If no TimerService is enabled the TimeClosable
will have no effect. |
TimeClosable(TimerService service,
java.lang.String name)
start the named timer (if the service is not null).
|
TimeClosable(TimerService service,
java.util.function.Supplier<java.lang.String> name_supplier)
start the named timer (if the service is not null).
|
Modifier and Type | Method and Description |
---|---|
void |
change(java.lang.String new_name)
close the current timing phase and open a
new one.
|
void |
close() |
public TimeClosable(TimerService service, java.lang.String name)
service
- name
- public TimeClosable(TimerService service, java.util.function.Supplier<java.lang.String> name_supplier)
service
- name_supplier
- public TimeClosable(AppContext conn, java.lang.String name)
TimerService
If no TimerService
is enabled the TimeClosable
will have no effect.conn
- name
- public TimeClosable(AppContext conn, java.util.function.Supplier<java.lang.String> name_supplier)
TimerService
If no TimerService
is enabled the TimeClosable
will have no effect.conn
- name_supplier
-