08-27-周三_17-09-29
This commit is contained in:
10
node_modules/CSSselect/test/tools/bench.js
generated
vendored
Normal file
10
node_modules/CSSselect/test/tools/bench.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
var ben = require("ben"),
|
||||
testString = "doo, *#foo > elem.bar[class$=bAz i]:not([ id *= \"2\" ]):nth-child(2n)",
|
||||
helper = require("./helper.js"),
|
||||
CSSselect = helper.CSSselect,
|
||||
compile = CSSselect.compile,
|
||||
dom = helper.getDefaultDom();
|
||||
|
||||
//console.log("Parsing took:", ben(1e5, function(){compile(testString);}));
|
||||
var compiled = compile(testString);
|
||||
console.log("Executing took:", ben(1e6, function(){CSSselect(compiled, dom);})*1e3);
|
Reference in New Issue
Block a user