java杂乱
為什么80%的碼農都做不了架構師?>>> ??
1 時間戳
long timeOfBefore=System.currentTimeMillis();try {Thread.sleep(5000);} catch (InterruptedException e) {e.printStackTrace();}long timeOfAfter=System.currentTimeMillis();System.out.println(timeOfAfter);System.out.println(timeOfBefore);System.out.println(timeOfAfter-timeOfBefore);2 工具類以類名Utils結尾,且需要是final的,其中的方法必須是static的 3 四舍五入保留兩位小數
DecimalFormat df = new DecimalFormat("#.00"); return Double.valueOf(df.format(valueOfTps / constant)); or public static String saveTwoPoint(double d) {return savePoint(d, 2);}public static String savePoint(double d, int point) {return String.format("%.".concat(point + "f"), d);}轉載于:https://my.oschina.net/112612/blog/1594970
總結
- 上一篇: JavaScript进行UTF-8编码与
- 下一篇: PHP - windows下编译PHP