We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 299d7c4 commit 5a5d7d9Copy full SHA for 5a5d7d9
1 file changed
src/debug.js
@@ -130,8 +130,13 @@ function createDebug(namespace) {
130
// that float must be the delta time in milliseconds.
131
var args = arguments;
132
var beginTime = exports.hrtime();
133
+ var ended = false;
134
135
var mark = function (title, extraArgs) {
136
+ if (ended) {
137
+ return;
138
+ }
139
+
140
section.title = title;
141
section.deltaTime = exports.hrtime(beginTime);
142
if (extraArgs.length) {
@@ -147,7 +152,11 @@ function createDebug(namespace) {
147
152
var section = {
148
153
title: '[begin]',
149
154
end: function () {
150
- return mark('[end]', arguments);
155
+ try {
156
+ return mark('[end]', arguments);
157
+ } finally {
158
+ ended = true;
159
151
160
},
161
mark: function () {
162
return mark('[mark]', arguments);
0 commit comments