advance = () => setTimeout(() => {
      const elapsed = performance.now() - start
      const currentProgress = Math.min(100, Math.round(elapsed / totalTime * 100))
      progress(currentProgress)

      if (currentProgress >= 100) {
        return resolve({
          url: 'http://via.placeholder.com/350x150.png',
          name: file.name
        })
      } else {
        advance()
      }
    }, 20)
Create a recursive timeout that advances the progress.