File: test/speed.js

Recommend this page to a friend!
  Classes of Emil Kilhage   jQuery Benchmark Tool   test/speed.js   Download  
File: test/speed.js
Role: Example script
Content type: text/plain
Description: Example script
Class: jQuery Benchmark Tool
Measure time it takes to execute JavaScript code
Author: By
Last change: Update of test/speed.js
Date: 2 years ago
Size: 1,985 bytes
 

Contents

Class file image Download
$.benchmark.disable(); plugin("jQuery - Benchmark"); module("$.benchmark", 10000); test("new $.benchmark()", function(i){ var test; while(i--){ test = new $.benchmark(); } }); test("$.benchmark()", function(i){ var test; while(i--){ test = $.benchmark(); } }); test("bench.start() -> bench.end()", function(i){ var test = new $.benchmark(); while(i--){ test.start().end(); } }); test("bench.mark(i)", function(i){ var test = new $.benchmark(true); while(i--){ test.mark(i).mark(i+"_", i); } }); test("bench.reset()", function(i){ var test = new $.benchmark(true); while(i--){ test.reset(); } }); module("$.benchmark.Test", 10000); test("new $.benchmark.Test()", function(i){ var test; while(i--){ test = new $.benchmark.Test(); } }); test("$.benchmark.Test()", function(i){ var test; while(i--){ test = $.benchmark.Test(); } }); test("test.start() -> test.end()", function(i){ var test = new $.benchmark.Test(); while(i--){ test.start().end(); } }); test("test.start(i) -> test.end(i)", function(i){ var test = new $.benchmark.Test(); while(i--){ test.start(i).end(i); } }); test("test.reset()", function(i){ var test = new $.benchmark.Test(); while(i--){ test.reset(); } }); (function(){ var tests = [], o = 10, r = o, _test = new $.test(); while(o--) { tests.push(function(){}); } test("test.setup(), "+r+" functions", function(i) { var test = new $.test(); while(i--) { test.setup(tests); } }); test("test.add() without setup, "+r+" functions", function(i) { var test = new $.test(); while(i--) { test.add(tests, false); } }); _test.add(tests, false); test("test.run() without setting up or starting any tests, "+r+" functions", function(i) { while(i--) { _test.run(false); } }); }());