ImageScience 3.0.0

imagescience.utility
Class Timer

java.lang.Object
  extended by imagescience.utility.Timer

public class Timer
extends java.lang.Object

Facilitates measuring of the computation time consumed by a process. The measuring is done with millisecond precision. Note, however, that the accuracy of the measuring depends on the timing granularity of the underlying operating system and may be coarser than milliseconds.


Field Summary
 Messenger messenger
          The object used for message displaying.
 
Constructor Summary
Timer()
          Default constructor.
 
Method Summary
 void pause()
          Pauses the timer.
 void resume()
          Resumes the timer.
 void start()
          Starts the timer.
 long stop()
          Stops the timer and returns the elapsed time with millisecond precision.
 long time()
          Returns the elapsed time with millisecond precision.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messenger

public final Messenger messenger
The object used for message displaying.

Constructor Detail

Timer

public Timer()
Default constructor.

Method Detail

start

public void start()
Starts the timer.


pause

public void pause()
Pauses the timer.


resume

public void resume()
Resumes the timer.


time

public long time()
Returns the elapsed time with millisecond precision.

Returns:
The elapsed time with millisecond precision.

stop

public long stop()
Stops the timer and returns the elapsed time with millisecond precision.

Returns:
The elapsed time with millisecond precision.

ImageScience 3.0.0

Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.

IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.

IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.