Created
August 23, 2017 17:14
-
-
Save gustavomdsantos/ab501683c0144e3e5f4281dc566bad50 to your computer and use it in GitHub Desktop.
Oscila latencia para simular conexão com internet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Oscila latencia para simular conexão com internet | |
| var min = 500; | |
| var max = 5000; | |
| var changeTime = 2000; | |
| var log = true; | |
| window.setInterval( | |
| function(){ | |
| window.latencia = Math.random() * (max - min) + min; | |
| if(log) { | |
| console.log(window.latencia); | |
| } | |
| } | |
| , changeTime); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment