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.

Examples

To stop the timer, do

FB.Canvas.stopTimer();

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.

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

Parameters

NameTypeRequiredDescription

callback

Function

no

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