"I sing while I cook."
Translation:Jag sjunger medan jag lagar mat.
under det att is very very formal in Swedish, I don't think I've ever used it in speech. It's suitable for bureaucratic texts or similar, not for cooking and singing.
under tiden is not such a great translation here either, what we really want is medan which is the most natural way of saying this in Swedish.