Skip to content

Instantly share code, notes, and snippets.

View jurepolutnik's full-sized avatar

Jure Polutnik jurepolutnik

View GitHub Profile
function timeDigest() {
angular.element(document.querySelector('[ng-app]'))
.injector().invoke(function($rootScope) {
var a = performance.now();
$rootScope.$apply();
console.log(performance.now()-a);
});
}
function count() {
var root = angular.element(document.querySelector('[ng-app]')).injector().get('$rootScope');
var count = root.$$watchers ? root.$$watchers.length : 0; // include the current scope
var countScopes = 1;
var pendingChildHeads = [root.$$childHead];
var currentScope;
while (pendingChildHeads.length)