diff options
author | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-08-28 20:31:35 +0400 |
---|---|---|
committer | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-08-28 20:31:35 +0400 |
commit | 270a3f6e22782278a5254c4c073cad2ad8b6ccf8 (patch) | |
tree | 55ea555868fdab92eff97395d36aa83599f0cf39 /timer/HRTimerResolution.java | |
parent | b3705cf40072203386d784c161419cbcc9e9d164 (diff) | |
download | fernflower-270a3f6e22782278a5254c4c073cad2ad8b6ccf8.tar fernflower-270a3f6e22782278a5254c4c073cad2ad8b6ccf8.tar.gz fernflower-270a3f6e22782278a5254c4c073cad2ad8b6ccf8.tar.lz fernflower-270a3f6e22782278a5254c4c073cad2ad8b6ccf8.tar.xz fernflower-270a3f6e22782278a5254c4c073cad2ad8b6ccf8.zip |
java-decompiler: post-import cleanup (unneeded files dropped)
Diffstat (limited to 'timer/HRTimerResolution.java')
-rw-r--r-- | timer/HRTimerResolution.java | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/timer/HRTimerResolution.java b/timer/HRTimerResolution.java deleted file mode 100644 index 318694f..0000000 --- a/timer/HRTimerResolution.java +++ /dev/null @@ -1,68 +0,0 @@ -import java.text.DecimalFormat; - -import com.vladium.utils.timing.ITimer; -import com.vladium.utils.timing.TimerFactory; - -// ---------------------------------------------------------------------------- -/** - * A demo class to show off the higher resolution available from HRTimer class - * and to investigate the resolution offered by Java "time-related" - * methods other than System.currentTimeMillis().<P> - * - * Make sure that hrtlib.dll JNI lib is in java.library.path or TimerFactory - * will fall back to the Java system timer: - * <PRE> - * >java -Djava.library.path=(dir containing hrtlib.dll) HRTimerResolution - * </PRE> - * - * @author (C) <a href="mailto:vroubtsov@illinoisalumni.org">Vlad Roubtsov</a>, 2002 - */ -public class HRTimerResolution -{ - // public: ................................................................ - - public static void main (final String [] args) throws Exception - { - final DecimalFormat format = new DecimalFormat (); - format.setMinimumFractionDigits (3); - format.setMaximumFractionDigits (3); - - // create an ITimer using the Factory class: - final ITimer timer = TimerFactory.newTimer (); - - // JIT/hotspot warmup: - for (int i = 0; i < 3000; ++ i) - { - timer.start (); - timer.stop (); - timer.getDuration (); - timer.reset (); - } - - final Object lock = new Object (); // this is used by monitor.wait() below - - for (int i = 0; i < 5; ++ i) - { - timer.start (); - - // uncomment various lines below to see the resolution - // offered by other Java time-related methods; with all - // lines commented out this loop reports time elapsed - // between successive calls to t.start() and t.stop(), thus - // providing an estimate for timer's raw resolution - - synchronized (lock) { lock.wait (1); } - //Thread.currentThread ().sleep (1); - //Thread.currentThread ().sleep (0, 500); - //Thread.currentThread ().join (1); - - timer.stop (); - - System.out.println ("duration = " - + format.format (timer.getDuration ()) + " ms"); - timer.reset (); - } - } - -} // end of class -// ---------------------------------------------------------------------------- |