TODO SPAM, REMEMBER TO UNCOMMIT

This commit is contained in:
Mark Nadal 2020-02-03 14:26:01 -08:00
parent efd055c2b0
commit fa8a63606c

View File

@ -114,6 +114,30 @@
<script src="/jquery.js"></script>
<script src="/gun.js"></script>
<script src="/gun/nts.js"></script>
<h1><button id="spamit">SPAM</button></h1><script>spamit.onclick = function(){
if(window.TO){ clearInterval(window.TO); return; }
window.TO = setInterval(function(){
var w = 2;
function go(i){
var S = +new Date;
var ref = gun.get(Gun.text.random(12)).put({data: Math.random()}, function(ack){
console.log((+new Date - S)/1000, ack.err, ack.ok);
ref.off();
});
}
while(w--){ go(w) }
},1)
}
Gun.on('opt', function(root){
root.opt.localStorage = false;
this.to.next(root);
if(root.once){ return }
root.on('out', function(msg){
msg.DBG_s = +new Date;
this.to.next(msg);
})
})
</script>
<script>
// Check out the interactive tutorial
// for how to build a simplified version