File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -72,18 +72,18 @@ object. This is useful for inspecting large complicated objects. Defaults to
7272- ` colors ` - if ` true ` , then the output will be styled with ANSI color codes.
7373Defaults to ` false ` . Colors are customizable, see below.
7474
75- ### console.time(label )
75+ ### console.time(timerName )
7676
7777Starts a timer that can be used to compute the duration of an operation. Timers
7878are identified by a unique name. Use the same name when you call
79- [ ` console.timeEnd() ` ] ( #console_console_timeend_label ) to stop the timer and
79+ [ ` console.timeEnd() ` ] ( #console_console_timeend_timername ) to stop the timer and
8080output the elapsed time in milliseconds. Timer durations are accurate to the
8181sub-millisecond.
8282
83- ### console.timeEnd(label )
83+ ### console.timeEnd(timerName )
8484
8585Stops a timer that was previously started by calling
86- [ ` console.time() ` ] ( #console_console_time_label ) and prints the result to the
86+ [ ` console.time() ` ] ( #console_console_time_timername ) and prints the result to the
8787console.
8888
8989Example:
Original file line number Diff line number Diff line change @@ -55,19 +55,19 @@ Console.prototype.dir = function(object, options) {
5555} ;
5656
5757
58- Console . prototype . time = function ( label ) {
59- this . _times . set ( label , process . hrtime ( ) ) ;
58+ Console . prototype . time = function ( timerName ) {
59+ this . _times . set ( timerName , process . hrtime ( ) ) ;
6060} ;
6161
6262
63- Console . prototype . timeEnd = function ( label ) {
64- var time = this . _times . get ( label ) ;
63+ Console . prototype . timeEnd = function ( timerName ) {
64+ var time = this . _times . get ( timerName ) ;
6565 if ( ! time ) {
66- throw new Error ( 'No such label : ' + label ) ;
66+ throw new Error ( 'No such timer name : ' + timerName ) ;
6767 }
6868 const duration = process . hrtime ( time ) ;
6969 const ms = duration [ 0 ] * 1000 + duration [ 1 ] / 1e6 ;
70- this . log ( '%s: %sms' , label , ms . toFixed ( 3 ) ) ;
70+ this . log ( '%s: %sms' , timerName , ms . toFixed ( 3 ) ) ;
7171} ;
7272
7373
You can’t perform that action at this time.
0 commit comments