Back when I had to do this I tried to get it right and never could.  Eventually i gave up and did best estimate but made sure it never appeared stuck.  Even if progress bar wasn’t moving, there was still something to indicate it was working and not stuck.  This made it take longer but reduced the number of calls about it being stuck or people killing the process because they thought it was stuck.  So it actually saves time.