There are many tools available to do the performance analysis (such as this one, for example).
And an obvious question - why can't this run in a background job where timeout does not apply? It seems a rather odd requirement to do some massive updates in Annn table in an online transaction. Not to mention that direct DELETE from such table doesn't look like a good idea...