Going by Raymond Murphy's English Grammar in Use, we can use the -ing clause when two things happen at the same time. And it's also stated there, we use -ing when one action happens during another action.
Do two things happening at the same time, and one action happening during another, mean the same thing?
If I were to construct a sentence that read I wrote that letter to you,(while) getting yelled at by my mom. And that is probably why there're so many spelling mistakes in that., would it be grammatically correct? Is not using the while in the sentence okay?