com.plumtree.uiinfrastructure.common
Class TimeTracker

java.lang.Object
  extended by com.plumtree.uiinfrastructure.common.TimeTracker

public class TimeTracker
extends java.lang.Object

The TimeTracker Class is used to measure time differences, in milliseconds.

Author:
scottc Created on May 3, 2003

Constructor Summary
TimeTracker()
           
 
Method Summary
 long GetCheckpointTimeFromCheckpoint(java.lang.String startCheckpoint, java.lang.String endCheckpoint)
          GetCheckpointTimeFromStart attempts to retrieve the two checkpoints with the keys given.
 long GetCheckpointTimeFromStart(java.lang.String checkpoint)
          GetCheckpointTimeFromStart attempts to retrieve a checkpoint with the key given.
 long GetTotalTime()
          The time in milliseconds since the TimeTracker creation or the last Reset() is returned.
 void Reset()
          The TimeTracker is reset.
 void SetCheckpoint(java.lang.String checkpoint)
          SetCheckpoint is used to create a time checkpiont for later retrieval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeTracker

public TimeTracker()
Method Detail

Reset

public void Reset()
The TimeTracker is reset. Alternative to creating a new one.


GetTotalTime

public long GetTotalTime()
The time in milliseconds since the TimeTracker creation or the last Reset() is returned.

Returns:
long

SetCheckpoint

public void SetCheckpoint(java.lang.String checkpoint)
SetCheckpoint is used to create a time checkpiont for later retrieval. The checkpoint is identified by a string, and stored in an internal XPHashtable with that string as a key.

Parameters:
checkpoint -

GetCheckpointTimeFromStart

public long GetCheckpointTimeFromStart(java.lang.String checkpoint)
GetCheckpointTimeFromStart attempts to retrieve a checkpoint with the key given. It returns -1 if there is no checkpoint by the given name. It returns the time in milliseconds between the creation of the TimeTracker or its last Reset() and the checkpoint time.

Parameters:
checkpoint -
Returns:
long the time between the start of the time and the checkpoint

GetCheckpointTimeFromCheckpoint

public long GetCheckpointTimeFromCheckpoint(java.lang.String startCheckpoint,
                                            java.lang.String endCheckpoint)
GetCheckpointTimeFromStart attempts to retrieve the two checkpoints with the keys given. It returns -1 if either of the checkpoints do not exist. It returns the time in milliseconds between the start checkpoint and the end checkpoint time.

Parameters:
startCheckpoint -
endCheckpoint -
Returns:
long the time between the two checkpoints



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.