https://www.grammar-quizzes.com/adv_whenwhile.html
My wife gave birth to our daughter last night. Our little baby girl was napping when I phoned my family. I was staring at her little face while I was holding her. She was sleeping so peacefully.
When I called home, my brother picked up the phone. We were talking while my mother was listening in on our conversation. My brother said that she had tears in her eyes while I was talking about the birth.
When and while are "temporal" prepositions which are complemented (completed) by a time-related clause. (Huddleston, et. al. 700) When and while, along with several other adverbs, were reanalyzed (2002) as prepositions. At the same time, the complements that could follow a preposition were widened to include: a noun, noun phrase, gerund, infinitive, clause and more. See Prepositional Complements. In effect, we have a clause within a prepositional phrase! He was holding his baby [PP while [Cls you were talking.]] Also see While / When -ing "Reducing time-relative clauses"
When has four meanings:
interruption—He was holding his newborn baby when you called. ("called" ["rang up"] —short duration² )
same time—He was holding his newborn baby when (or while) he was talking on the phone. ("was talking" —longer duration³)
immediately after (in response)—When you called, he picked up his phone. ("called" and "picked up"—short duration)
anytime / whenever—When he has a question, he calls the doctor. (cause effect) See If v. When.
While has two meanings:
same time—He was holding his newborn baby while (or when) he was talking on the phone. (was talking — duration [process verb])
contrast—While some fathers are uncomfortable holding newborns, others are not. "whereas"
Long or short duration may be expressed by the meaning of the verb:
duration (process) such as talk, walk, eat, sleep, cook, study. (nonprogressive form) (See Verbs of Short and Long Duration)
short duration (punctual) such as bark, jump, clap, sneeze, gulp, begin, end, fall (nonprogressive form).
Long or short duration may be expressed by the tense of the verb:
duration (process) He has been calling you all day. That dog is barking. (progressive form) The dog barked. (habitually) (See Present, Past, Present Perfect.)
short duration (punctual) He called (rang). The dog barked. (once) (nonprogressive form) (See Past.)
When / While
Foreground vs. Background Activity
backgrounding (Ger) – a grammatical term for moving something out of central focus and into a position of less focus (less importance or less interest).
come up with (Phrasal Verb) – think of, put together, call to mind
conceive (V) – begin life (also, to form a notion, an opinion, a purpose, an idea) interruption (N) – a stop or break in the middle of an activity; a discontinuance; interference with action or speech
reveal (V) – announce publicly, make known to all tends to be (V Expr.) – is more likely to be; is more expected to be
yawn (V) (N) – an involuntary action of opening the mouth widely and taking air into the lungs
When
Express same-time v. immediately after
When / While
As, During, Throughout, Meanwhile
Other expressions for when and while