打印Ant目标执行时间 [英] Printing Ant target execution time

查看:175
本文介绍了打印Ant目标执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要打印对各单个Ant目标及其相关指标的执行时间。

I want to print the execution time taken for each individual Ant target and its dependent targets.

<target name="target1" depends="target2, target3"> 
....
</target>

在运行应显示以下输出

Target 2 - x seconds
Target 3 - y seconds
Target 1 - z seconds

这是如何实现这一点有什么建议?

Any suggestions on how to achieve this?

推荐答案

由于蚂蚁1.8.0可以使用 profilelogger 来做到这一点。

Since Ant 1.8.0 you can use a profilelogger to do this.

ant -logger org.apache.tools.ant.listener.ProfileLogger target

生成输出像

目标aTarget:开始星期四1月22日
  九点01分00秒CET 2009年

Target aTarget: started Thu Jan 22 09:01:00 CET 2009

回声:开始星期四1月22日九时01分00秒CET
  2009年
       [回应]回声任务

echo: started Thu Jan 22 09:01:00 CET 2009 [echo] echo-task

回声:finishedThu 1月22日9点01分00秒CET
  2009年(250毫秒)

echo: finishedThu Jan 22 09:01:00 CET 2009 (250ms)

邮编:开始星期四1月22日9时01分00秒CET
  2009年
        [拉链]大厦邮编:... \\ my.zip

zip: started Thu Jan 22 09:01:00 CET 2009 [zip] Building zip: ...\my.zip

邮编:finishedThu 1月22日9时01分01秒CET
  2009年(1313ms)

zip: finishedThu Jan 22 09:01:01 CET 2009 (1313ms)

目标aTarget:finishedThu 1月22日
  9时01分01秒CET 2009年(1719ms)

Target aTarget: finishedThu Jan 22 09:01:01 CET 2009 (1719ms)

这篇关于打印Ant目标执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆