(function(b,a){if(typeof define==='function'&&define.amd){define([],a)}else if(typeof module==='object'&&module.exports){module.exports=a()}else{b.ping=a()}})(this,function(){function a(b){return new Promise(function(c,d){var a=new Image();a.onload=function(){c(a)};a.onerror=function(){d(b)};a.src=b+'?random-no-cache='+Math.floor((1+Math.random())*0x10000).toString(16)})}function b(c,d){return new Promise(function(f,g){var e=new Date().getTime();var b=function(){var a=new Date().getTime()-e;a*=d||1;f(a)};a(c).then(b).catch(b);setTimeout(function(){g(Error('Timeout'))},5000)})}return b})