net.tomp2p.utils
Class TimingImpl

java.lang.Object
  extended by net.tomp2p.utils.TimingImpl
All Implemented Interfaces:
Timing

public class TimingImpl
extends Object
implements Timing

The implementation that is used for normal operation. This class uses System.currentTimeMillis() and Thread.sleep().

Author:
Thomas Bocek

Constructor Summary
TimingImpl()
           
 
Method Summary
 long currentTimeMillis()
           
 void sleep(int millis)
          Sleeps with throwing an InterruptedException
 void sleepUninterruptibly(int millis)
          Sleeps without throwing an InterruptedException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimingImpl

public TimingImpl()
Method Detail

currentTimeMillis

public long currentTimeMillis()
Specified by:
currentTimeMillis in interface Timing
Returns:
the time in millis for this system

sleep

public void sleep(int millis)
           throws InterruptedException
Description copied from interface: Timing
Sleeps with throwing an InterruptedException

Specified by:
sleep in interface Timing
Parameters:
millis - The time to sleep in milliseconds
Throws:
InterruptedException - If interrputed is called

sleepUninterruptibly

public void sleepUninterruptibly(int millis)
Description copied from interface: Timing
Sleeps without throwing an InterruptedException

Specified by:
sleepUninterruptibly in interface Timing
Parameters:
millis - The time to sleep in milliseconds


Copyright © 2013. All Rights Reserved.