You have my sympathy OP!
I am another one who thinks that if it is caused by an infection then no, don't take loperamide. But please do have the full daily dose of Dioralyte (or a generic brand of same) on every day that your D & V continues, as well as flat full sugar lemonade, and of course some water, but not too much plain water as it can dilute an already undernourished body.
When you start feeling hungry begin eating again slowly, with something like dry crackers or Matzos, with a little marmite (if you love it!), and/or dry toast with a little jam or marmalade on it. The most important thing is to not overload your digestive system with a lot of rich or fatty foods while it is still recovering, but if your body says yes, then some live plain bio yogurts can help get you GI tract back on track.
Once the infection has gone, a healthy adult shouldn't take more than a couple of days to get back to normal. If a young child gets ill with D & V I would always ask for medical advice, and sooner rather than later, as their little bodies can become dehydrated very quickly, which can become serious quite rapidly, so they may need to go on a saline drip or similar.
By the way, dehydration is a lot more complex than just a body lacking water. A very dehydrated person admitted to hospital, will actually have their plain water intake greatly reduced, and monitored.
I really hope you are feeling much better soon OP. 💐