while … is still the case; before … happens
あまり遠くに行かない内ににわか雨にあった。
Before I got very far, I was caught in a sudden shower.
彼は両親の知らない内に家出をした。
He ran away from home without his parents knowing.
でもその内にわかるでしょう
But you'll understand eventually.
— 崖の上のポニョ (2008)
今夜はどうせ私達お泊まりだから帰れる内に帰った方がいいわよ
Since we're staying over tonight anyway, you should head home while you still can.
あまり長く待たない内に彼がきた。
It wasn’t long before he arrived.