N3
うちに
While, During
熱いうちに食べて!
Eat it while it's hot!
Explanation
「うちに」 has 3 uses
1While you still can
Do it before the present state changes: 「温かいうちに食べて」 (eat it while it's hot).
熱いうちに食べて!
Eat it while it's hot!
お爺ちゃんがまだ元気なうちに家族皆で旅行に行こう!
Let's all go on a family trip while grandpa is still healthy!
2Before you know it
While something goes on, a change happens on its own: 「話しているうちに楽しくなった」 (as we talked, it became fun).
彼と毎日会ううちに、だんだんと彼のことが好きになってきた。
Meeting him every day, I gradually came to like him.
運転しているうちに眠くなったので、コンビニで休憩をした。
I got sleepy while driving, so I took a break at a convenience store. (At one point while driving)
3Within a span
After a span of time, 'within': 「一晩のうちに」 (overnight).
一晩の内に性格を変えることはできない。
You can't change your personality overnight.
一生の内に一度は聖書を読んでみたいと思っている。
I'd like to read the Bible at least once in my life.
Mixed up with
「うちに」 feels urgent: 「明るいうちに帰りましょう」 (Let's go home while it's still light). 「間に」 just states the period: 「昼休みの間に本を買った」.
A period with clear limits like 「1時から2時」 takes only 「間に」.
In the second use, the second half can't be your own will or an order. Don't say 「×テレビを見ているうちに、宿題をしよう」.