Skip to content

Instantly share code, notes, and snippets.

@amosrivera
Created July 6, 2015 14:20
Show Gist options
  • Save amosrivera/1f437baf549ceeb46ca9 to your computer and use it in GitHub Desktop.
Save amosrivera/1f437baf549ceeb46ca9 to your computer and use it in GitHub Desktop.
angular
.module("")
.directive("repeatTimeLog", repeatTimeLog);
/* @ngInject */
function repeatTimeLog($timeout, $log) {
var start, end;
return timeoutFunction;
function timeoutFunction(scope, element, attrs) {
if (scope.$first) $timeout(startFunction);
if (scope.$last) $timeout(endFunction);
}
function startFunction(){
start = new Date();
}
function endFunction(){
end = new Date();
$log.debug("## DOM rendering list took: " + (end - start) + " ms");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment