com.threerings.tudey.client.util
Class TimeSmoother

java.lang.Object
  extended by com.threerings.tudey.client.util.TimeSmoother

public class TimeSmoother
extends Object

Provides a continuous estimate of the current time (with millisecond precision) based on a series of discrete time updates, speeding up or slowing down (but never reversing) the local clock as necessary to stay in synch.


Constructor Summary
TimeSmoother(int time)
          Creates a new smoother with the given initial clock value.
 
Method Summary
 int getTime()
          Returns the current smoothed time estimate.
 void update(int time)
          Updates the smoother with the current value of the clock being tracked.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeSmoother

public TimeSmoother(int time)
Creates a new smoother with the given initial clock value.

Method Detail

update

public void update(int time)
Updates the smoother with the current value of the clock being tracked.


getTime

public int getTime()
Returns the current smoothed time estimate.



Copyright © 2011. All Rights Reserved.