public class TimeExecution extends Object
Add the logger RY_TIME_LOG with level = INFO to see the times in confluence logs.
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
TIME_LOG |
Constructor and Description |
---|
TimeExecution() |
Modifier and Type | Method and Description |
---|---|
static void |
time(Runnable somethingToRun,
String message)
Time and log the Runnable.
|
static void |
time(Runnable somethingToRun,
String message,
Long threashold)
Time the Runnable.
|
static <T> T |
time(Supplier<T> somethingToSupply,
String message)
Time and log the Supplier.
|
static <T> T |
time(Supplier<T> somethingToSupply,
String message,
Long threashold)
Time the Supplier and returns the result.
|
public static <T> T time(Supplier<T> somethingToSupply, String message, Long threashold)
message
- a message information for the log entrythreashold
- in ms. If null, log is written. If specified and the time exceeds this threadshold, the log is writtenpublic static void time(Runnable somethingToRun, String message, Long threashold)
message
- a message information for the log entrythreashold
- in ms. If null, log is written. If specified and the time exceeds this threadshold, the log is writtenpublic static void time(Runnable somethingToRun, String message)
message
- a message information for the log entryCopyright © 2022 Requirement Yogi. All rights reserved.