code: private void elapsedTime(long startTime)
      {
          /** time elapsed in nanoseconds */
          long eta = System.nanoTime() - startTime;
  
          sessionState.out.print("Elapsed time: ");
          if (eta < 10000000)
          {
              sessionState.out.print(Math.round(eta/10000.0)/100.0);
          }
          else
          {
              sessionState.out.print(Math.round(eta/1000000.0));
          }
          sessionState.out.println(" msec(s).");
      }
docs: Print elapsed time. Print 2 fraction digits if eta is under 10 ms.
  @param startTime starting time in nanoseconds