Definition of Pentameter
Pentameter is a literary device that can be defined as a line in verse or poetry with five strong metric feet or beats. There are different forms of pentameters: iamb, trochaic, dactylic and anapestic. The most commonly used pentameter in English.It can also be described as a line made up of ten syllables, with the first syllable stressed, the second not stressed, the third stressed, and so on, until the syllable of the 10th line is reached. For example:

“Should I compare you to a summer day? “

(Sonett 18, by William Shakespeare)

Types of Pentameter
Iamb Pentameter
Trochaic Pentameter
play on;
Give me more of it so that the appetite gets sick and thus dies.
This burden again! It had a dying fall:
O, it came over my e ar like the sweet sound… ”

This excerpt has an iambic pentameter style (stressed / stressed pattern), the stressed syllables are shown in bold. Here we can see that each line has five beats and the second syllable is stressed.

Example # 2: Canterbury Tales (By Geoffrey Chaucer).
To far away halwes, kowthe in sondry londes;
Of Engelond, after Caunterbury turn them,
The hooly blisful martir for seke
The seam has bumped as if they were wanted. “

This is another example of iambic pentameter" Iamb "and contains two syllables, with the first syllable unaccented and the second accented. This unstressed / stressed pattern emphasized the words.

Example 3: Holy Sonnet XIV (by John Donne)
"Beat my heart upon three people, God, for you, but knock, breathe, shine and try to improve.
So that I stand up and fall and bend myself are rich in Donne's poems. In this excerpt, the second and third lines follow this pattern perfectly. There are ten syllables in which the first syllables are not stressed, followed by stressed syllables.

Example 4: King Lear (By William Shakespeare)
“And my poor fool got stuck! No, no, no life!
Why should a dog, horse, rat have life,
And you have no breath at all? You don't come any more,
Never, never, never, never, never!
See that? Look at her, look, her lips,
Look there, look there ...! between unstressed and accentuated syllables in the fourth line.

Example No. 5: The attack of the light brigade (By Alfred, Lord Tennyson)
'Forward, the light brigade!
Charge for the weapons! 'he said:
In the valley of Death
He rode the six hundred. ”

This is an example of a dactyl pentameter, which follows an accented / unaccented / unaccented pattern. It is an elegiac poem, since the dactyl pentameter exists mainly in elegies. It functions as a building block and gives a regular rhythm to the poem.

Function of pentameter
Pentameter broadly governs individual verses in poems, couplets, and verses, and provides structural form to a poem. It also determines the style and rhythm of speech. It also brings order to words through regular use of accents in syllables and helps emphasize specific words that a poet desires. This is the main reason for variation in text through accented / unstressed patterns.
Pedantic Periphrasis