Progress Bar Based On TimeSpan?

Hi,
I was wondering if it’s possible to create a ProgressBar based on TimeSpan Calculation of an entire script. I know that we can calculate progress with an iteration through a list but I don’t like how it works. Any ideas? Thank you.