mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-10-19 23:30:56 +00:00
Update app.js
This commit is contained in:
parent
d5f7114f55
commit
4fb8beb948
15
app.js
15
app.js
|
@ -44,6 +44,7 @@ var exit = function(status) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var console = {
|
var console = {
|
||||||
|
_timers: {},
|
||||||
_messages: [],
|
_messages: [],
|
||||||
_join: function(args, sep) {
|
_join: function(args, sep) {
|
||||||
args = args || [];
|
args = args || [];
|
||||||
|
@ -85,6 +86,20 @@ var console = {
|
||||||
},
|
},
|
||||||
debug: function() {
|
debug: function() {
|
||||||
this._echo(arguments, "debug");
|
this._echo(arguments, "debug");
|
||||||
|
},
|
||||||
|
time: function(label) {
|
||||||
|
this._timers[label] = new Date();
|
||||||
|
},
|
||||||
|
timeLog: function(label, end) {
|
||||||
|
if (label in this._timers) {
|
||||||
|
console.debug(label + ": " + ((new Date()).getTime() - this._timers[label].getTime()) + "ms" + (end ? " - timer ended" : ""));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
timeEnd: function(label) {
|
||||||
|
if (label in this._timers) {
|
||||||
|
this.timeLog();
|
||||||
|
delete this._timers[label];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user