Although not exact, the line you quote is from William Shakespeare, but it is not from a play, ... it's from a poem. This line is from William Shakespeare's Sonnet 60:
Like as the waves make towards the pebbled shore, So do our minutes hasten to their end.
Further, in the tags you have added to the question, you have mentioned the "frailty of life" and the "passing of time." That is exactly what this quote refers to; therefore, I am assuming this is the quote you mean.
Now let's look at it in the context of the entire poem:
Like as the waves make towards the pebbled shore, / So do our minutes hasten to their end, / Each changing place with that which goes before, / In sequent toil all forwards do contend. / Nativity, once in the main of light, / Crawls to maturity, wherewith being crowned, / Crooked eclipses 'gainst his glory fight, / And time that gave doth now his gift confound. / Time doth transfix the flourish set on youth / And delves the parallels in beauty’s brow; / Feeds on the rarities of nature’s truth, / And nothing stands but for his scythe to mow. / And yet to times in hope my verse shall stand, / Praising thy worth, despite his cruel hand.
In the quote you provide, Shakespeare uses a simile to compare the waves slowly (but inevitably) moving towards the pebbles on the shore with the passage of time, specifically the passage of time within our earthly life. Everything that is born will eventually die. However, Shakespeare's point comes within the final couplet: his words are made immortal through this sonnet, therefore he has conquered death in that way. Those waves moving to that pebbled shore can't (and won't) reach his eternal lines of iambic pentameter. They will last forever.