<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>西红柿爱番茄 &#187; 测试工具</title>
	<atom:link href="http://www.ilovejs.net/archives/tag/%e6%b5%8b%e8%af%95%e5%b7%a5%e5%85%b7/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ilovejs.net</link>
	<description>到了创造为主的阶段，不忘继续学习</description>
	<lastBuildDate>Thu, 15 Dec 2011 06:18:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Watch对象更新</title>
		<link>http://www.ilovejs.net/archives/1066</link>
		<comments>http://www.ilovejs.net/archives/1066#comments</comments>
		<pubDate>Wed, 28 Jul 2010 20:19:41 +0000</pubDate>
		<dc:creator>Supersha</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Watch]]></category>
		<category><![CDATA[测试工具]]></category>

		<guid isPermaLink="false">http://www.ilovejs.net/?p=1066</guid>
		<description><![CDATA[这次对Watch对象添加了一个新方法：iterate。主要是用于这样的情况，同时测试多个指定循环次数的情况，比如可以同时指定1000、2000、3000、4000&#8230;等等，通过iterate方法，就可以查看到几个测试用例在这几个循环次数下的时间消耗，iterate的用法如下： [javascript] Watch.iterate({ &#34;title&#34;:[&#34;getElementsByTagName&#34;,&#34;childNodes&#34;], &#34;loop&#34;:[1000,2000,4000,5000,10000,20000,40000,100000], &#34;interval&#34;:1500, &#34;fn&#34;:[ function(){ document.getElementById(&#34;div&#34;).getElementsByTagName(&#34;p&#34;);}, function(){ document.getElementById(&#34;div&#34;).childNodes;} ] }); [/javascript] iterate方法带有一个对象字面量参数，这个对象字面量的参数的属性包括title数组、loop循环次数数组、interval更新显示的时间间隔、fn测试函数数组。说起来可能比较虚，看例子吧：Watch.iterate()。]]></description>
			<content:encoded><![CDATA[<p>这次对Watch对象添加了一个新方法：iterate。主要是用于这样的情况，同时测试多个指定循环次数的情况，比如可以同时指定1000、2000、3000、4000&#8230;等等，通过iterate方法，就可以查看到几个测试用例在这几个循环次数下的时间消耗，iterate的用法如下：<br />
[javascript]<br />
Watch.iterate({<br />
  &quot;title&quot;:[&quot;getElementsByTagName&quot;,&quot;childNodes&quot;],<br />
  &quot;loop&quot;:[1000,2000,4000,5000,10000,20000,40000,100000],<br />
  &quot;interval&quot;:1500,<br />
  &quot;fn&quot;:[<br />
    function(){ document.getElementById(&quot;div&quot;).getElementsByTagName(&quot;p&quot;);},<br />
    function(){  document.getElementById(&quot;div&quot;).childNodes;}<br />
  ]<br />
});<br />
[/javascript]<br />
iterate方法带有一个对象字面量参数，这个对象字面量的参数的属性包括title数组、loop循环次数数组、interval更新显示的时间间隔、fn测试函数数组。说起来可能比较虚，看例子吧：<a  href="/lab/iterate/">Watch.iterate()</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovejs.net/archives/1066/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

