How to get is internet connection checking time too long (timeout)?

Dear all,
I have use $cordovaNetwork to check the internet status. However, if my app connect to a “NOT workable” wifi, my APP will do nothing but contineous trying. Is it possible to set the timeout for the internet checking?

Please help me, thank you.