I was distracted by girls in bikinis while I was on the computer. What was the question?
I'll do it when I have time to get to it. Meanwhile, I'm looking at those girls in bikinis.
(I don't think I've ever heard anybody use "whilst" in my entire life.)
Do those examples help you to see the difference between when and while?
Student or Learner