Created
December 27, 2013 22:16
-
-
Save venil7/8153414 to your computer and use it in GitHub Desktop.
console.log, that prints number of milliseconds since last console.log invocation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.timed_log = function() { | |
var args = Array.prototype.splice.call(arguments, 0); | |
var time = +new Date(); | |
var diff = time - (this._time || time); | |
args.unshift(diff); | |
console.log.apply(console, args); | |
this._time = time; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment