It's my understanding that it wasn't unusual for ancient battles to go on for hours of nonstop fighting. If you were a soldier on the front lines and you really had to pee or poop, would you just go right where you stood and keep fighting? Or would you run off to the side quick to do your business and then run back. Not sure if there'll even be any sources for this I'm just curious.
We actually have no good evidence to suggest that ancient battles would feature hours of non-stop fighting. At least for Classical Greece, the indications of duration in battle descriptions are always vague. Battles are said to go on "for a long time," but there is no definition of what is a long time, and it will obviously be relative to how long a warrior could sustain the effort. Depending on how you picture ancient hoplite combat, a long time could be as little as 15 minutes. We simply don't know for how long Greek armies would actually be in combat.
We do have evidence that the time spent in combat could actually be very short, or even nil. In several cases in Greek history, armies broke before contact. If we assume that most battles were indeed short, or even over before they began, we can see how some armies were able to fight several battles in a single day, like the Athenians who defeated first the Boiotians and then the Chalkidians in quick succession in 506 BC.
The clearer indications of time we get are for the parts of a battle that do not involve hand-to-hand fighting. It could, for instance, take many hours for an army to deploy itself for battle. The larger the army, the more time this would take. We are also frequently told that the aftermath - the chase of routing enemies - would go on until nightfall. These stages of the battle could indeed go on for a very long time, but they did not involve continuous fighting. Deployment in particular seems to have allowed some freedom for people to move about. We sometimes hear of men rushing to their positions when they learn that the enemy is indeed about to attack; the implication is that many men would spall off from the formation whenever it seemed like there was a window for them to go about their business.
In other words, the time Greek warriors spent actually fixed to their position in the line was limited. But battle was terrifying, and terror loosens the bowels. It was well known to the Greeks that men facing battle were likely to soil themselves. As far as we know, those things would happen where they happened. The comedian Aristophanes has a character describe War as "the terrible one, the stalwart one, the one that's on the legs" (Peace 240-241) - that is, the one that makes you shit yourself. He has another character quite literally bring his brown cloak because he knows there will be a battle. Only comedy is prepared to deal with such subjects, which is why our evidence is so limited; historical accounts don't talk about warriors soiling themselves. But these jokes make clear that it definitely happened, that it was normal, and that there was no chance to do it in private.