035-Java-026

来源:互联网 发布:超级基因优化液大结局 编辑:程序博客网 时间:2024/06/04 21:07

测量时间间隔

import java.util.*;  public class DiffDemo {    public static void main(String args[]) {      try {         long start = System.currentTimeMillis( );         System.out.println(new Date( ) + "\n");         Thread.sleep(5*60*10);         System.out.println(new Date( ) + "\n");         long end = System.currentTimeMillis( );         long diff = end - start;         System.out.println("Difference is : " + diff);      } catch (Exception e) {         System.out.println("Got an exception!");      }   }}


原创粉丝点击