Created
June 10, 2012 22:59
-
-
Save brentsowers1/2907597 to your computer and use it in GitHub Desktop.
jQuery attachment types common code
This file contains 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
var clickStartTime; | |
function timeAction(localThis, actionFunction) { | |
var startTime = new Date(); | |
actionFunction.call(localThis); | |
var endTime = new Date(); | |
alert("Took " + (endTime.getTime() - startTime.getTime()) + " ms to run"); | |
} | |
function callbackFunction() { | |
var doneDate = new Date(); | |
var diff = doneDate.getTime() - clickStartTime.getTime(); | |
alert("It took " + diff + " ms"); | |
return false; | |
} | |
// All generated content will go in a div with ID container | |
$(document).ready(function() { | |
$("#container").mousedown(function() { | |
clickStartTime = new Date(); | |
}); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment