3 ms·
Don't use integer timestamps as object keys. What if there's more than one action in any given second? I'd much prefer an array with objects as element, each o
by perlgeek 11y ago
Don't use integer timestamps as object keys. What if there's more than one action in any given second?
I'd much prefer an array with objects as element, each object storing its own timestamp.
- egladman 11y agoI was hoping no two actions would occur on the same millisecond. Thanks for the feedback.
- TheDong 11y agoJust for you, I went through my logs for my current irc server and checked how often irc messages occured on the same millisecond. I found on the order of a few thousand such events out of millions of lines total. In addition, that's just based on my perception; IRC is NOT an ordered protocol, so if multiple people ran this same logger, they'd end up with different stream and different duplicate keys (same thing as events lost I might add). My log, also, conveniently contains joins, parts, notices, ctcps, and all that other jazz because I used a mature logging library.