There are two things, the physical travel time and the amount of time you have to be at the gate to board, and they are not the same thing. The couple of times I've traveled out of Terminal 4, it has taken about 15 to 20 minutes between walking and the train to get between the two. I think you have to show up at the gate least 15 minutes before they close the plane doors, so clearly someone would have to plan on an absolute minimum of a half an hour if changing planes (this is only if the flights are internal Spain or Schengen area, need much more if you have to clear immigration from outside Schengen).