File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 55
66// assumes the angular application is at least around the document's body
77
8- /* global angular, performance */
9- angular . element ( document . body ) . injector ( ) . invoke ( function timeApply ( $rootScope ) {
10- console . profile ( '$apply' ) ;
11- var started = performance . now ( ) ;
12- $rootScope . $apply ( ) ;
13- var takes = performance . now ( ) - started ;
14- console . log ( 'idle $apply takes' , takes , 'ms' ) ;
15- console . profileEnd ( ) ;
16- return takes ;
17- } ) ;
8+ /* global performance */
9+ ( function profileIdleTiming ( angular ) {
10+
11+ function timeApply ( $rootScope ) {
12+ console . profile ( '$apply' ) ;
13+ var started = performance . now ( ) ;
14+ $rootScope . $apply ( ) ;
15+ var takes = performance . now ( ) - started ;
16+ console . log ( 'idle $apply takes' , takes , 'ms' ) ;
17+ console . profileEnd ( ) ;
18+ return takes ;
19+ }
20+ timeApply . $inject = [ '$rootScope' ] ;
21+
22+ angular . element ( document . body ) . injector ( ) . invoke ( timeApply ) ;
23+ } ( window . angular ) ) ;
You can’t perform that action at this time.
0 commit comments