日常在做一些性能测试的时候会通过执行时间来判断执行时长,java中最简单的方式如下: //开始时间 long startL= new Date().getTime(); //这里需要导入 java.util.*;包 exceFun(); long endL= new Date().getTime(); //执行时间 System.out.println("startL:"+senStrat +" endL:"+senEndL +" 执行时长:"
今天为了通过java读取properties文件,google了很长时间,终于找到了.现在特记录之和大家一起分享. 下面直接贴出代码:java类 public class Mytest public static void readFile(String fileName) {//传入参数fileName是要读取的资源文件的文件名如(file.properties) InputStream in = null; Properties pros = new Properties(); tr
背景:最近写一个通过excel批量导入数据的功能,里面含有时间,但是java读取之后把时间转为了距离1990年1月1号的天数,比如excel中时间为2018/9/16 18:30,java读取之后变成43359.77083就会有问题 出现的问题: SimpleDateFormat startFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = startFormat.parse(tmpMap.get(&quo