File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
modules/angular2/src/platform/browser/tools Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import {isPresent, NumberWrapper} from 'angular2/src/facade/lang';
44import { window } from 'angular2/src/facade/browser' ;
55import { DOM } from 'angular2/src/platform/dom/dom_adapter' ;
66
7+ export class ChangeDetectionPerfRecord {
8+ constructor ( public msPerTick : number , public numTicks : number ) { }
9+ }
10+
711/**
812 * Entry point for all Angular debug tools. This object corresponds to the `ng`
913 * global variable accessible in the dev console.
@@ -41,7 +45,7 @@ export class AngularProfiler {
4145 * ng.profiler.timeChangeDetection({record: true})
4246 * ```
4347 */
44- timeChangeDetection ( config : any ) {
48+ timeChangeDetection ( config : any ) : ChangeDetectionPerfRecord {
4549 var record = isPresent ( config ) && config [ 'record' ] ;
4650 var profileName = 'Change Detection' ;
4751 // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened
@@ -66,5 +70,7 @@ export class AngularProfiler {
6670 var msPerTick = ( end - start ) / numTicks ;
6771 window . console . log ( `ran ${ numTicks } change detection cycles` ) ;
6872 window . console . log ( `${ NumberWrapper . toFixed ( msPerTick , 2 ) } ms per check` ) ;
73+
74+ return new ChangeDetectionPerfRecord ( msPerTick , numTicks ) ;
6975 }
7076}
You can’t perform that action at this time.
0 commit comments