When, While, As Subtle Difference
https://dictionary.cambridge.org/grammar/british-grammar/as-when-or-while
When 表示一個完成的短事件,加 just 強調機乎同時
He was walking back to his flat when he heard an explosion.
The phone always rings just when I’m closing the front door.
While, As 表示兩件較長的事情同時發生
We spent long evenings talking in my sitting-room while he played the music he had chosen and explained his ideas.
We were lying on the beach sunbathing as they were playing volleyball.