org.crosswire.jsword.examples

## Class Speed

- java.lang.Object
- - org.crosswire.jsword.examples.Speed

- All Implemented Interfaces:
    Runnable

      public class Speed
      extends Object
      implements Runnable

  Speed is a simple benchmark that tests how fast a version is. The current set of tasks that we perform are rather arbitrary. But that is something that we can improve on when we have more usage information.

  Progress report. All builds are Debug unless *ed:

       Date          Bible       VM              Time/s
       1999.12.08    Raw (Mem)   HS 1.0.1         20
       1999.12.08    Raw (Mem)   MVM 5.00.3167   541
       1999.12.09    Raw (Disk)  HS 1.0.1       >600
       1999.12.10    Ser         HS 1.0.1         78
       1999.12.11    Ser         HS 1.0.1          6.7
       1999.12.11    Raw (Mem)   HS 1.0.1         11
       1999.12.11    Raw (Disk)  HS 1.0.1       1072
       1999.12.11    Ser         MVM 5.00.3167     8
       1999.12.12    Ser         HS 1.0.1          4
       1999.12.12    Ser *       HS 1.0.1          3

  Author:
    Joe Walker
  See Also:
    `The GNU Lesser General Public License for details.`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private Book` | `book` The version to test
    `private long` | `endTime` The end time of the benchmark
    `private long` | `startTime` The start time of the benchmark

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Speed(Book book)` Basic constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `dummyDisplay(Passage ref)` Dummy display routine.
    `long` | `getBenchmark()` Accessor for the speed of the test
    `Book` | `getBook()` Accessor for the version that we are testing
    `void` | `run()` This is what to call to execute a benchmark
    `void` | `setBook(Book book)` Accessor for the version that we are testing

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### startTime

          private long startTime

      The start time of the benchmark

    - #### endTime

          private long endTime

      The end time of the benchmark

    - #### book

          private Book book

      The version to test

  - ### Constructor Detail

    - #### Speed

          public Speed(Book book)

      Basic constructor
      Parameters:
        `book` - the book

  - ### Method Detail

    - #### run

          public void run()

      This is what to call to execute a benchmark
      Specified by:
        `run` in interface `Runnable`

    - #### dummyDisplay

          private void dummyDisplay(Passage ref)
                             throws BookException

      Dummy display routine. We might want to add some XSL styling to this.
      Parameters:
        `ref` - The passage to format for display
      Throws:
        `BookException`

    - #### getBenchmark

          public long getBenchmark()

      Accessor for the speed of the test
      Returns:
        the benchmark for the test

    - #### getBook

          public Book getBook()

      Accessor for the version that we are testing
      Returns:
        the book

    - #### setBook

          public void setBook(Book book)

      Accessor for the version that we are testing
      Parameters:
        `book` - the book