Please check out the following sentences. Which is better?
(1) While (you are) crossing the street, you must be very careful.
(2) When (you are) crossing the street, you must be very careful.
I would say "when," but either is OK.
Hi Ashiuhto
I agree with SoothingDave, with the addition of the following possible, subtle nuance, which may explain my, and SD's, preference:
"Whilst" suggests whilst you are actually physically crossing the road.
"When" tends to include the time before you cross the road - when, of course, you look both ways!
Hope this helps
R21