[間「あいだ」]/[間「あいだ」]に => During A, During A (before A is finished/over) N2
Time, Situation
を[境「さかい」]に => A is set as a border/limit N1
Degree/ Level/Amount