As suggested above, to be pedantic the difference between sunset at sea level and at altitude depends on latitude as well as altitude.
At FL400 (ish) it's nearly 30 mins after sea level at London latitude, but at the equator it's less than 10 minutes. This is because at the equator the sun takes a nose-dive to the horizon, but at higher latitudes it takes a more glancing angle, and takes longer to sink (hence why twilight is much longer at high latitudes), but you probably know that.