要计算 execution time,谢谢

[复制链接]
查看11 | 回复1 | 2007-9-28 15:14:14 | 显示全部楼层 |阅读模式
你可以在调用这个类之间写上一个开始时间long startTime=System.currentTimeMillis();在结束调用这个类之后再写上一个结束时间long endTime=System.currentTimeMillis();最后这个类的运行时间就是long totalTime=endTime-startTime不知道你要的可是这个意思
回复

使用道具 举报

千问 | 2007-9-28 15:14:14 | 显示全部楼层
t0 =System.currentTimeMillis(); //...这里写你要查看的方法所花的时间delta_t = System.currentTimeMillis()-t0;System.out.println("一共花了:"+delta_t );
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行