Created
July 6, 2015 14:20
-
-
Save amosrivera/1f437baf549ceeb46ca9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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