TestStopWatch.java 440 B

1234567891011121314151617181920212223242526
  1. package util;
  2. public class TestStopWatch {
  3. public static void main(String[] args) {
  4. StopWatch sw = new StopWatch();
  5. sw.start();
  6. try {
  7. Thread.sleep(1000);
  8. } catch (InterruptedException e) {
  9. e.printStackTrace();
  10. }
  11. sw.stop();
  12. System.out.println(sw.toMS());
  13. sw.start();
  14. try {
  15. Thread.sleep(1000);
  16. } catch (InterruptedException e) {
  17. e.printStackTrace();
  18. }
  19. sw.stop();
  20. System.out.println(sw.toMS());
  21. }
  22. }