Skip to content

Instantly share code, notes, and snippets.

@stagas
Created October 20, 2010 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stagas/637138 to your computer and use it in GitHub Desktop.
Save stagas/637138 to your computer and use it in GitHub Desktop.
var self = this
, c = 0
, dels = []
, o
, k
, tim = new Date()
var free = function() {
var t = new Date()
if (t - tim > 10000) {
while (ok = dels.pop()) {
delete self[ok[0]][ok[1]]
}
tim = t
}
}
var next = function() {
o = Math.floor(Math.random() * 16).toString()
+ Math.floor(Math.random() * 16).toString()
if (typeof self[o] === 'undefined') self[o] = {}
k = Math.floor(Math.random() * 10000000000).toString()
self[o][k] = ['3523', '2347']
c++
if (c % 10000 === 0) console.log(c)
dels.push([o,k])
process.nextTick(function() {
free()
next()
})
}
next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment