あいだに details
write + (and…) + while
kaite iruaidani
while; during — at some point within an interval
meaning: while writing
私が寝てるあいだに、誰かケーキ食べたでしょ。
watashi ga neteru aida ni, dareka keeki tabeta desho.
Somebody ate the cake while I was asleep, didn't they? casual
バスを待っているあいだに、いいアイデアを思いついた。
basu o matte iruaidani, ii aidea o omoitsuita.
I came up with a good idea while waiting for the bus. neutral
Examples
during — the main event happens at a point inside the interval, often behind the interval-holder's back
私が寝てるあいだに、誰かケーキ食べたでしょ。
watashi ga neteru aida ni, dareka keeki tabeta desho.
Somebody ate the cake while I was asleep, didn't they? casual
バスを待っているあいだに、いいアイデアを思いついた。
basu o matteiruaidani, ii aidea o omoitsuita.
I came up with a good idea while waiting for the bus. neutral
留守のあいだに、荷物が届いていた。
rusu no aida ni, nimotsu ga todoite ita.
A package had arrived while I was out. neutral
ご滞在のあいだに、ぜひ一度お立ち寄りください。
go taizai no aida ni, zehi ichido o tachiyori kudasai.
Please do drop by at some point during your stay. formal
Formation
{V-te}いるあいだにattaches to て-form{N}のあいだにattaches to noun
Notes
Related patterns
Similar
あいだに names a neutral interval with knowable endpoints (留守のあいだに), while うちに adds that the window is closing and the chance lapses with it — which is why deadlines and ない-clauses pull うちに.
Both translate "while" — ながら keeps ONE subject doing two actions at once; あいだに opens an interval in which even a different subject can act.
とき points at an occasion and accepts punctual and durative clauses alike; あいだに insists on a durative interval (ている, or a span noun) and places the main event strictly inside it — 着いたとき is fine, ×着いたあいだに is not.