Skip to content

Commit 69b5a48

Browse files
author
chagris
committed
add %d outputFormatter to show exact ms diff
debug-js#626
1 parent 5313c69 commit 69b5a48

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/common.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,21 @@ function setup(env) {
8383
}
8484

8585
/**
86-
* Map %+ to outputting diff
86+
* Map %+ to humanize()'s defaults (1000ms diff => "1s")
8787
*/
8888

8989
createDebug.outputFormatters['+'] = function(format, args) {
9090
return '+' + createDebug.humanize(this.diff);
9191
}
9292

93+
/**
94+
* Map %d to returning milliseconds
95+
*/
96+
97+
createDebug.outputFormatters.d = function(format, args) {
98+
return '+' + this.diff + "ms";
99+
}
100+
93101
/**
94102
* Map %n to outputting namespace prefix
95103
*/

0 commit comments

Comments
 (0)