Class CommandContext.ArgumentTiming

  • Enclosing class:
    CommandContext<C>

    public static final class CommandContext.ArgumentTiming
    extends 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 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