There are several things these two poems have in common. Andrew Marvell's "To His Coy Mistress" discusses the importance of time, and the swift passage of time. It may be noted that the carpe diem ("seize the day") motif is present in both pieces.
Had we but world enough, and time,
This coyness, lady, were no crime.
We would sit down and think which way
To walk, and pass our long love's day…
The speaker notes that if the young woman and he had all the time in the world, they could do whatever they want and dawdle (his sense of her use of time), but since youth flies by so quickly, they need to get down to the business of love-making.
Herrick also makes note of the importance of time in "To The Virgins, To Make Much of Time:"
GATHER ye rosebuds while ye may,
Old time is still a-flying :
And this same flower that smiles to-day
To-morrow will be dying.
Herrick notes that young woman should use her time wisely, for in the blink of an eye the things of youth will be lost forever, as time races toward death. The poem continues to observe the passage of the sun (symbolizing life) and its passage across the heavens (so quickly) toward sunset (symbolizing death).
Herrick continues to urges virgins (if we read his poem literally) to marry while they are young—not to while away the time until it is too late and they are past their "prime:"
Then be not coy, but use your time,
And while ye may go marry:
For having lost but once your prime
You may for ever tarry.
While the traditional carpe diem poem suggests living for today and having no regard for tomorrow, moral restraint or self-control, this is where Herrick's poem differs greatly from Marvell's.
By urging marriage, the speaker introduces a religious and moral element to the pursuit of pleasure and the immediate gratification of one’s desires...
In Marvell's poem, on the other hand, the speaker does not concern himself with morality, but with instant gratification. In fact, he promotes it, with (it can be inferred) his own gratification in mind. Throughout Marvell's first stanza, the speaker describes all of the wondrous things they could spend their time doing if time were not of the essence (as he advises).
Marvell alludes to the issue of time once again:
But at my back I always hear
Time's winged chariot hurrying near...
Death, the speaker reminds, will come sooner than one expects. He also points out that beauty fades quickly only to find its way to the tomb. Whereas Herrick seems to offer advice from experience and places importance on marriage, Marvell introduces the topic of his lust. For if they wait, Marvell writes, the beauty that ends in the grave will be accompanied by the speaker's desire—if they waste their time.
Marvell's poem suggests that the speaker and the young woman join together in common purpose—that she relinquish her virginity to him (rather than "acting" shyly) so that even though they cannot stop time, they can have a marvelous time—making time (personified) fight to keep up with them.
Thus, though we cannot make our sun
Stand still, yet we will make him run.