ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen McConnell" <mcconn...@apache.org>
Subject RE: measuring performance of a task
Date Mon, 27 Sep 2004 13:49:56 GMT


> -----Original Message-----
> From: lists@bitfaeule.net [mailto:lists@bitfaeule.net]
> Sent: 27 September 2004 15:28
> To: user@ant.apache.org
> Subject: measuring performance of a task
> 
> 
> Hello,
> 
> I would like to automatically measure the time ant spends executing a
> task and write it to my logfile.
> 
> What's the best way to do that? I would like to avoid writing a custom
> task in Java.

I guess you could create a build listener.  Using the events posted to
the listener I think you can capture the start and end of task execution
based on task name or target name.  The interface to look at is
BuildListener which is the org.apache.tools.ant package.  Once you have
created an implementation of this interface you can register it with
your project using something like:

   BuildListener listener = new MyBuildListener();
   getProject().addBuildListener( listener );

Cheers, Steve,


> 
> Thank you
> 
> jacques
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message