1. Walk it yourself
Task 1: set invincibility to 0 and run into one enemy. How many frames until you are defeated?
Task 2: set invincibility to 3 seconds (180 frames) and see how many hits it takes to get through the group of 4.
This runs the same calculation as the video "Why Do Games Give You Invincibility Frames After Damage?". Every 1/60 second (one frame), it checks whether the player's box and an enemy's box overlap. If they do, the player takes 10 damage (HP 100). Taking damage starts an invincibility timer, and while the timer is running, no damage is taken (the player blinks during that time).
This page uses the same calculation as the diagrams in the video (60 frames per second, 40-wide boxes, 10 damage, HP 100). These are not values from any real game. The rates change with enemy spacing and speed, and there is no single right invincibility time. It always calculates in fixed steps of 1/60 second, however often the screen refreshes.
Sources and credits: same as the video description (AI was used to make the diagrams and script; no game footage or characters are used).