i need a progress\_bar that follow the time of a song. how can i set the end time of progress\_bar exactly in the moment when the song finish?

ex. if my song has duration of 4:38 minutes how can i create a progress\_bar for this specif period of time ( from when i click to 4:38 min after) ?

```
 var progressBar = $('#progress-bar'),
 width = 0;

 progressBar.width(width);

 var interval = setInterval(function() {
    width += 10;
    progressBar.css('width', width + '%');

    if (width >= 100) {
       clearInterval(interval);
    }
  }, 1000)

```

thanks.