4 <title>Test Event Handling Performance</title>
5 <script src="benchmark.js"></script>
6 <script src="jquery-basis.js"></script>
7 <script>var old = jQuery.noConflict(true);</script>
8 <script src="../dist/jquery.js"></script>
14 var s = (new Date).getTime();
16 for ( var n = 0; n < 5; n++ ) {
17 for ( var i = 0; i < num; i++ ) {
25 var oldNum = (new Date).getTime() - s;
28 s = (new Date).getTime();
30 for ( var n = 0; n < 5; n++ ) {
31 for ( var i = 0; i < num; i++ ) {
39 var curNum = (new Date).getTime() - s;
41 jQuery("#num").text( old.fn.jquery + ": " + oldNum + " " + jQuery.fn.jquery + ": " + curNum );
46 var s = (new Date).getTime();
48 for ( var n = 0; n < 5; n++ ) {
49 for ( var i = 0; i < num; i++ ) {
50 p.css("position", "relative");
53 p.css("display", "block");
57 var oldNum = (new Date).getTime() - s;
60 s = (new Date).getTime();
62 for ( var n = 0; n < 5; n++ ) {
63 for ( var i = 0; i < num; i++ ) {
64 p.css("position", "relative");
67 p.css("display", "block");
71 var curNum = (new Date).getTime() - s;
73 jQuery("#num2").text( old.fn.jquery + ": " + oldNum + " " + jQuery.fn.jquery + ": " + curNum );
76 <style>p { position: absolute; top: 5px; left: 5px; }</style>
79 <p><strong>Getting Values:</strong> <span id="num">Loading...</span></p>
80 <p><strong>Setting Values:</strong> <span id="num2">Loading...</span></p>