Calculate battery discharge

Hello, I am trying to calculate the download time of a device. Does anyone know how to do it? Are there any existing plugins for Ionic 3?
Thanks.