菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
import java.util.*; public class DiffDemo { public static void main(String args[]) { try { long start = System.currentTimeMillis( ); System.out.println(new Date( ) + "
"); Thread.sleep(5*60*10); System.out.println(new Date( ) + "
"); long end = System.currentTimeMillis( ); long diff = end - start; System.out.println("Difference is : " + diff); } catch (Exception e) { System.out.println("Got an exception!"); } } }
运行结果
Thu Sep 17 02:43:18 UTC 2015
Thu Sep 17 02:43:21 UTC 2015
Difference is : 3031