It is really based on the idea that every time the Flip command is used at the end of the 'Main Loop', this is when the screen is updated i.e. each 'Frame'
Very simply, FPS counters count the time taken to perform a whole 'Game Loop' between Flip commands. The reciprocal is the number of Frames Per Second.
i.e. PseudoCode
Start_Timer
Do Game_Loop
Flip (Refresh Screen)
Stop_Timer
Calculate Frames_Per_Second
Repeat
Very simply, FPS counters count the time taken to perform a whole 'Game Loop' between Flip commands. The reciprocal is the number of Frames Per Second.
i.e. PseudoCode
Start_Timer
Do Game_Loop
Flip (Refresh Screen)
Stop_Timer
Calculate Frames_Per_Second
Repeat