Learn to use "while" correctly
Uses of While
The conjunction 'while' is used to show simultaneous time.
A) Express contrast between two things
Example:
1) I slept while my brother cooked.
B) As a subordinate conjunction of time
Example :
1) Action showing time: Many students are sleeping while the trainer was explaining.
2) An action in the past showing time: She worked with many high profile people while she was on a project in London.
From the above example we deduce that:
1) The two contrasting statements in the given sentence are: I (I slept) & II (my brother cooked)
2) 'While' and 'When' are different words.
‘While' is used to show simultaneous time
'When' means 'at that specific time'