Let's say you want to limit some event to 5 occurrences every 20 seconds, you would set up the RateLimit like so:
var limit = new RateLimit(20); // Initialize a 20 second ticklog
// For events that we initiate...
if (limit.count('myevent_id') <= 5)) {
// Do some stuff