how to make percentage of a running script?

dear friends,

does anyone know how to make the percentage of proccess of a running script?
:confused:
like we always see in windows, when we install a program, there is always an indicator using percent value (from 0% to 100%)

i need this for my time consuming script

thanks before

look into this link