Real time data request

Hi,
I am creating a real time application. So I need to post my data to mysql database for every 5 secs.
But it is not working properly and make mobile to hang. Is there any solutions to fix this in ionic?
Thanks…