javascript: setInterval execute with out stoping
===

im creating a chrome extestion and i need to use a interval. 

the time the interval will go off every time, is choosen by the user itself.

the function execture on every open tab and send data to it.

my problem is that the "timer" dosnt work like it should, it just execute all at once like a normal while loop.

here is the code:

    chrome.tabs.query({}, function (tabs) {
    //the times the code need to run is by the amount of tabs that is open
            setInterval(function () {
                if (i < tabs.length) {

                    chrome.tabs.sendRequest(tabs[i].id, { input: "uCanSend",

                        userName: myName,
                        password: myPass,

                        subject: mySubject, msg: myMsg,

                        linkName1: myLinkName1,
                        linkURL1: myLinkURL1,

                        linkName2: myLinkName2,
                        linkURL2: myLinkURL2

                    }, function (response) { });

                }
                i++;
            }, timeInMintus //the time that the code need to run every time);
        });

i have no idea what am im doing worng.
any idea how to fix it that i will run correctly?

(sorry for my english)
