File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -130,8 +130,13 @@ function createDebug(namespace) {
130130 // that float must be the delta time in milliseconds.
131131 var args = arguments ;
132132 var beginTime = exports . hrtime ( ) ;
133+ var ended = false ;
133134
134135 var mark = function ( title , extraArgs ) {
136+ if ( ended ) {
137+ return ;
138+ }
139+
135140 section . title = title ;
136141 section . deltaTime = exports . hrtime ( beginTime ) ;
137142 if ( extraArgs . length ) {
@@ -147,7 +152,11 @@ function createDebug(namespace) {
147152 var section = {
148153 title : '[begin]' ,
149154 end : function ( ) {
150- return mark ( '[end]' , arguments ) ;
155+ try {
156+ return mark ( '[end]' , arguments ) ;
157+ } finally {
158+ ended = true ;
159+ }
151160 } ,
152161 mark : function ( ) {
153162 return mark ( '[mark]' , arguments ) ;
You can’t perform that action at this time.
0 commit comments