Stop Loading Timer

The method FB.Canvas.stopTimer() should be used in conjunction with setDoneLoading. Call stopTimer when you wish to stop timing the page load for a period of time, such as when you are waiting for the user to click a button on an interstitial page. Follow it by startTimer to restart the timer and then setDoneLoading when the page load is complete.

If you specify a callback function, it will be called with an integer, in milliseconds, of the timing of the page load, beginning from the time when the first bytes arrive on the client, and ending from the point at which you call this function.


To stop the timer, do


you'll need to call startTimer before calling setDoneLoading.

To get the time elapsed so far, specify a callback. Here we pop up a dialog to display the load time so far.

    function (result) {
        alert("Blocked on user input after " + result.time_delta_ms + " milliseconds");


Name Type Required Description




(optional) A function called back with the intermediate page load time.


Type Description


An object with one property is returned, time_delta_ms, an integer which is the load time in milliseconds.