Skip to content

Instantly share code, notes, and snippets.

@justinwinslow
Last active August 29, 2015 14:26
Show Gist options
  • Save justinwinslow/643f5f7fa5223efb3786 to your computer and use it in GitHub Desktop.
Save justinwinslow/643f5f7fa5223efb3786 to your computer and use it in GitHub Desktop.
Simple ng-repeat rendering timer
angular.module('someModule', [])
.directive('ngRepeatTimer', function() {
var start;
return function(scope) {
if (scope.$first) {
start = new Date().getTime();
}
if (scope.$last){
console.log('ng-repeat rendering time:', new Date().getTime() - start);
}
};
});
// <li ng-repeat="thing in things" ng-repeat-timer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment