bak_time test

        Calendar calendarBegin = Calendar.getInstance();
        long beginLong = calendarBegin.getTimeInMillis();
        Date date_begin = new Date();
        Thread.sleep(1000);
        Calendar calendarEnd = Calendar.getInstance();
        long endLong = calendarEnd.getTimeInMillis();
        Date date_end = new Date();
       
        System.out.println("beginTime: " + new SimpleDateFormat("yyyy-MM-DD HH:mm:ss:SSS").format(date_begin));
        System.out.println("endTime: " + new SimpleDateFormat("yyyy-MM-DD HH:mm:ss:SSS").format(date_end));
        System.out.println("Times:" + (endLong - beginLong) + "s");

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章