Skip to content

Commit

Permalink
debug & benchmark updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 26, 2013
1 parent 590a7ee commit 0108e71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 5 additions & 7 deletions examples/todomvc/js/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
// toggle them one by one
// then delete them one by one

// do not run when testing in PhantomJS
if (window.location.search === '?benchmark=1') {
runBenchmark()
}
(function () {

function runBenchmark () {
var benchSetting = window.location.search.match(/\bbenchmark=(\d+)/)
if (!benchSetting) return

var itemsToAdd = 200,
var itemsToAdd = +benchSetting[1],
now = window.performance && window.performance.now
? function () { return window.performance.now(); }
: Date.now,
Expand Down Expand Up @@ -74,4 +72,4 @@ function runBenchmark () {
}
}, 0)

}
})()
3 changes: 3 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ var utils = module.exports = {
warn: function() {
if (!config.silent && console) {
console.warn(join.call(arguments, ' '))
if (config.debug) {
console.trace()
}
}
},

Expand Down

0 comments on commit 0108e71

Please sign in to comment.