keithssy
2013-10-14 09:48 阅读 1.0k

当前的System.currentTimeMillis()减去之前的System.currentTimeMillis()得到了负数,不解

a类里的方法
[code="java"]
public void work(){
long startTime = System.currentTimeMillis();
druidService.queryCostL();
druidService.queryMeter();
druidService.queryMeterData();
druidService.queryPaymentD();
// logger.info("DruidJob job ----" + (System.currentTimeMillis() - startTime) + " ms");
//存入数据库
druidService.insert("DruidJob job",String.valueOf((System.currentTimeMillis() - startTime)));
}

[/code]
b类里的方法
[code="java"]
public void work(){
long startTime = System.currentTimeMillis();
c3p0Service.queryCostL();
c3p0Service.queryMeter();
c3p0Service.queryMeterData();
c3p0Service.queryPaymentD();
// logger.info("C3p0Job job ----" + (System.currentTimeMillis() - startTime) + " ms");
//存入数据库
c3p0Service.insert("C3p0Job job",String.valueOf((System.currentTimeMillis() - startTime)));
}
[/code]

数据库里的情况:

[img]http://dl2.iteye.com/upload/attachment/0090/1594/6dcd1542-5270-34f9-8be7-08871a3d657d.png[/img]

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐