<html>
<head>
<title>DataType Tests</title>
</head>
<body class="yui3-skin-sam">
<h1>DataType Performance Tests</h1>
<p><select id="testSelector"></select> <input type="button" value="Run Test" id="btnRun" disabled=true></p>
<script type="text/javascript">
(function() {
YUI({
base: "/build/",
filter: "debug",
logInclude:{"perf":true, "datatype-number":true},
useConsole: true
}).use("console", "profiler", "dump", "datatype", function(Y) {
// Set up the page
var BTNRUN = Y.one("#btnRun"),
myConsole = new Y.Console().render();
BTNRUN.set("disabled", false);
Y.on("click", function(e){
}, BTNRUN);
Y.namespace("example").Perf = function() {
var selectNode = Y.one("#testSelector"),
allTests = [];
return {
init: function() {
this.register("Test number parsing", function() {
var i = -250,
max = 250,
j=0,
number, string;
for(; i<max; i++) {
string = Y.DataType.Number.format(number,
{prefix:"pre",decimalPlaces:2,decimalSeparator:",",thousandsSeparator:".",suffix:"post"});
}
});
},
register: function(testName, testFn) {
var index = allTests.length;
allTests[index] = testFn;
selectNode.appendChild(optionEl);
},
run: function() {
allTests[whichTest].apply(this);
}
}
}();
});
})();
</script>
</body>
</html>