All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Timer.Timer

java.lang.Object
   |
   +----Timer.Timer

public class Timer
extends Object
RUNNING() == true <==> start() called with no corresponding call to stop() All times are given in units of msec.


Constructor Index

 o Timer()
post : initializes Timer to 0 msec

Method Index

 o elapsed()
post : RUNNING() ==> returns the time since last call to start() !RUNNING() ==> returns total elapsed time
 o reset()
post : stops timing, if currently RUNNING(); resets accumulated time to 0.
 o start()
post : starts the timer.
 o stop()
post : stops the timer.

Constructors

 o Timer
 public Timer()
post : initializes Timer to 0 msec

Methods

 o start
 public void start()
post : starts the timer. accumulates time across multiple calls to start.

 o stop
 public long stop()
post : stops the timer. returns the time elapsed since the last matching call to start(), or 0 if no such matching call was made.

 o elapsed
 public long elapsed()
post : RUNNING() ==> returns the time since last call to start() !RUNNING() ==> returns total elapsed time

 o reset
 public void reset()
post : stops timing, if currently RUNNING(); resets accumulated time to 0.


All Packages  Class Hierarchy  This Package  Previous  Next  Index