I'll try to cover ancient times. Hand to hand fighting with sword and spear was a hard physical effort combined with tremendous emotional stress. Hand to hand combat such as this could not for very long before the opposing fronts were physically drained and unable to continue. It's extremely unlikely that such combat lasted for more that fifteen minutes at a time. Most likely it wwas far shorter. Most of these conflicts does not seem to have ended with one side fighting it's way into the enemy formation and routing the enemy. In cases where this happened both sides seem to have takes a few paces back so that the gap seperating them was a few yards. There then was a lull in fighting as the rival sides faced each other, recovering teir strength and confidence, perhaps yelling or throwing their remaining missiles at the enemy. Eventually one of the sides was able to renew combat and surged forward in a fresh charge to renew combat.
With each time that the opposing lines came into contact and parted without a result it must have been harder after the next lull to urge to increasingly weary men forward once again. Both sides increasingly became physically exhausted, the men in the front rank from the physical effort of fighting, the in the rear ranks from the strain of waiting, being unable to see what was going on, and knowing that their formation might collapse at any moment and the a vengeful enemy appear to slaughter anyone who did not run fast enough. Casaulties in this stage of battle would be relatively few. Judging from greek battles actually less than 5 percent until one side broke and fled. These casualties mostly consisted of the bolder men who tried to cut their way into the enemy lines. While the greeks put their bravest men in the front and rear ranks of a unit the Romans put their most veteran man in the rear to push the more unexperienced units forward. The confrontation between two lines of infantry may well have lasted over an hour or more, since we hear of battles lasting more than two to four hours altogether. In its entirity all this was decided by stamina and aggression. Discipline and experience added to a unit's endurance since the men in the front could now flee until the ranks behind collapsed. Aggression was needed to push the men forward into a clash with the enemy once more, since this was the most likely way of causing an enemy collapse.
All this is very different from what we've been showed in movies and television. One on one fighting did not actually occur as the armies fought as a unit and tried to harm the enemy at exposed points as the back of the neck, the arm and such. Most of the actual casaulties would happen as the broken enemy fled an one side slaughtered them as they ran.
In addition to the actual fighting lining up the men in formation before a battle was equally as time consuming as the battle itself. If both sides decided that they felt confident enough for battle both sides marched out of their camps to deploy into battle order. By the time the process was complete many units would have marched many miles, apart from having to stop and wait for the units ahead of them to contract from marching order into battle formation. In most cases while this was going on, on one side the enemy on the other side was occupied with an equally laborious process, but it was normal to send ut cavalry and light troops to protect the columns as they delpoyed.
Source: The Fall of Carthage Adrian Goldsworthy