[間「あいだ」]/[間「あいだ」]に => During A, During A (before A is finished/over) N2
Time, Situation
[終「お」]わる => To finish A; A ends N4
Secondary Verb
[時「とき」] => At the time A N5
Time
Vた[時「とき」] => After having done something N5
Time