Adam Khoury

Donate funds to show love and support

Click the button below to donate funds securely online. You can use your PayPal account or a credit card.

Your donations help free up my time to produce more content and assist in covering server costs. It's also a great way to say thanks for the content!

Application Configuration

Adam will be adding options here soon.

Script Execution Timing Tutorial for Ajax Server Calls

Published :
Author :
Adam Khoury
Learn to accurately time server script execution in both JavaScript HTML applications and ActionScript 3.0 in Flash applications. Since both languages are so very similar we do not have to change any of the essential code to make the script execution timing possible in both scenarios. We create variables that access the Date() object, then we get total milliseconds since time in the computing world began. Doing this once at the top of your code then once again at the end of your script, you then get how many milliseconds pass while your script runs if you subtract the first variable from the second. <script> function anyFunction(){ // getTime() - returns local total milliseconds for // the date object referenced from Jan 1, 1970 var ms = new Date().getTime(); // Run chunky JavaScript or server Ajax calls to PHP here var execTime = (new Date().getTime() - ms) / 1000; alert(execTime); } anyFunction(); </script>