Package cloud.commandframework.context
Class CommandContext.ArgumentTiming
- java.lang.Object
-
- cloud.commandframework.context.CommandContext.ArgumentTiming
-
- Enclosing class:
- CommandContext<C>
public static final class CommandContext.ArgumentTiming extends java.lang.Object
Used to track performance metrics related to command parsing. This is attached to the command context, as this depends on the command context that is being parsed.The times are measured in nanoseconds.
-
-
Constructor Summary
Constructors Constructor Description ArgumentTiming()
Created a new argument timing instanceArgumentTiming(long start)
Created a new argument timing instance without an end timeArgumentTiming(long start, long end, boolean success)
Created a new argument timing instance
-
Method Summary
Modifier and Type Method Description long
getElapsedTime()
Get the elapsed timevoid
setEnd(long end, boolean success)
Set the end timevoid
setStart(long start)
Set the start timeboolean
wasSuccess()
Check whether or not the value was parsed successfully
-
-
-
Constructor Detail
-
ArgumentTiming
public ArgumentTiming(long start, long end, boolean success)
Created a new argument timing instance- Parameters:
start
- Start time (in nanoseconds)end
- End time (in nanoseconds)success
- Whether or not the argument was parsed successfully
-
ArgumentTiming
public ArgumentTiming(long start)
Created a new argument timing instance without an end time- Parameters:
start
- Start time (in nanoseconds)
-
ArgumentTiming
public ArgumentTiming()
Created a new argument timing instance
-
-
Method Detail
-
getElapsedTime
public long getElapsedTime()
Get the elapsed time- Returns:
- Elapsed time (in nanoseconds)
-
setEnd
public void setEnd(long end, boolean success)
Set the end time- Parameters:
end
- End time (in nanoseconds)success
- Whether or not the argument was parsed successfully
-
setStart
public void setStart(long start)
Set the start time- Parameters:
start
- Start time (in nanoseconds)
-
wasSuccess
public boolean wasSuccess()
Check whether or not the value was parsed successfully- Returns:
true
if the value was parsed successfully,false
if not
-
-