source: release-kits/lirk3/ant-scripts/tasks/antelope/docs/manual/bk03ch10.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 3.3 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 10. Stopwatch</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="Antelope Users Guide"><link rel="up" href="bk03.html" title="Additional Ant Tasks"><link rel="prev" href="bk03ch09.html" title="Chapter 9. Variable Task"><link rel="next" href="bk03ch11.html" title="Chapter 11. Limit"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. Stopwatch</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch09.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch11.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="stopwatch"></a>Chapter 10. Stopwatch</h2></div></div></div>
2<STYLE TYPE="text/css"> <!-- @import url(./style.css); --> </STYLE>
3 <p>
4The Stopwatch task makes it easy to add performance timing to Ant targets. Stopwatches are named so that multiple watches can run simultaneously.
5</p><p>
6To use this task in your build files, include a task definition like this:
7</p><p>
8</p><pre class="programlisting">
9
10 &lt;taskdef name="stopwatch" classname="ise.antelope.tasks.StopWatchTask"/&gt;
11
12</pre><p>
13</p><p>
14</p><div class="table"><a name="id2521484"></a><p class="title"><b>Table 10.1. Stopwatch Task Attributes</b></p><table summary="Stopwatch Task Attributes" border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td>name</td><td>The name for the stopwatch. The elapsed time or total time will be stored as an Ant property with this name.</td><td>None</td><td>Yes</td></tr><tr><td>action</td><td>Valid values are "start", "stop", "elapsed", and "total".</td><td>"start"</td><td>No</td></tr></tbody></table></div><p>
15</p><p>
16The stopwatch is started with the "start" action. When the action is "elapsed" or "total", the running time of the stopwatch is printed out. Both "stop" and "total" stop the stopwatch and reset it to zero. "elapsed" prints out the current running time of the stopwatch without stopping it.
17</p><p>
18Example:
19</p><pre class="programlisting">
20
21&lt;stopwatch name="timer1"/&gt;
22&lt;!-- do some tasks here... --&gt;
23&lt;stopwatch name="timer1" action="elapsed"/&gt; &lt;!-- print the elapsed time --&gt;
24&lt;!-- do some more tasks here... --&gt;
25&lt;stopwatch name="timer1" action="total"/&gt; &lt;!-- print out the total time --&gt;
26
27</pre><p>
28</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk03ch11.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. Variable Task </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 11. Limit</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.