added performance test suite with two sample performance tests

This commit is contained in:
Eric Rowell
2012-07-14 09:57:21 -07:00
parent 5bfcf3ffa8
commit 2548e3c2ef
5 changed files with 104 additions and 2 deletions

View File

@@ -1,6 +1,18 @@
var numTests = 0;
var testCounter = null;
var before, after;
function startTimer() {
var date = new Date();
before = date.getTime();
}
function endTimer(str) {
var date = new Date();
after = date.getTime();
var diff = after - before;
console.log(str + ': ' + diff + 'ms');
}
function warn(condition, message) {
test(condition, message, true);
}