Because I am not a teacher of the native language, I cannot say exactly, but reply it for the sense that I usually use.
I think that those words have an about the same meaning.
But "うちに" is used well in everyday conversation.
It means "within".
But "within the period" mean "期限内に"or"期限までに" say in japanese.
I am English beginner.I apologize that if it cannot be understood.m(_ _)m