Currently we poll every 2000ms for account change in MetaMask.
Instead, we can use a listener for account changes, like this:
window.ethereum.on("accountsChanged", (accounts: Array<any>) => {
//Handle the new accounts.
//"accounts" will always be an array, but it can be empty.
//The current account is at accounts[0]
});