while/during~ something happened
Used to express that something happened during a specific time period or event.
This pattern indicates that an action or state occurred within a certain duration or while another event was ongoing. The key is that the action in the main clause is completed or happens at some point inside that time frame, not throughout the entire period. For example, if you say 寝ている間に電話がありました, it means the phone rang at some point while you were sleeping, not that it rang continuously.
It is often used to talk about opportunities or changes that happen during a certain period, like when someone is away or busy. The time period can be expressed with a verb (dictionary form), a noun with の, or an adjective. Remember that the main clause often uses past tense to describe a completed action that occurred during that time.
This pattern is neutral in formality and commonly used in both speaking and writing. It is important not to confuse it with 間 (without に), which describes an action that continues for the whole period. For example, 寝ている間、ずっと音楽を聞いていました means you listened to music for the entire duration of sleeping.