diff options
author | jeresig <jeresig@gmail.com> | 2010-10-10 13:39:06 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-10-10 13:39:06 -0400 |
commit | 63c892b1ed1d51b7d8759f2fb6d52b0e6a11d419 (patch) | |
tree | d4a7088ae6f70c8d2fab7afbe32870a7300064eb /speed/closest.html | |
parent | 6f0b06aa9b467096ae781cf33f18fa925923cf6f (diff) | |
download | jquery-63c892b1ed1d51b7d8759f2fb6d52b0e6a11d419.tar.gz jquery-63c892b1ed1d51b7d8759f2fb6d52b0e6a11d419.zip |
Make some more tweaks to the closest perf test suite.
Diffstat (limited to 'speed/closest.html')
-rw-r--r-- | speed/closest.html | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/speed/closest.html b/speed/closest.html index ca2017480..bb31f5d8b 100644 --- a/speed/closest.html +++ b/speed/closest.html @@ -1,7 +1,7 @@ <!doctype html> <html> <head> - <title>Test Event Handling Performance</title> + <title>Test .closest() Performance</title> <script src="benchmark.js"></script> <script src="jquery-basis.js"></script> <script>var old = jQuery.noConflict(true);</script> @@ -11,12 +11,14 @@ var node = $("#child"), name; jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) { - name = "closest '" + item + "'"; + setTimeout(function(){ + name = "closest '" + item + "'"; - jQuery("#results").append("<li>" + name + "<ul>" + - "<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 500, name) + "</li>" + - "<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 500, name) + "</li>" - + "</ul></li>"); + jQuery("#results").append("<li>" + name + "<ul>" + + "<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 2500, name) + "</li>" + + "<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 2500, name) + "</li>" + + "</ul></li>"); + }, 100); }); }); </script> |