public int Check(timestamp Timestamp, TimeSpan TimeWindow) { if (!Timestamp.Valid()) { return(-1); } DateTime current = Timestamp.GetValue(); while ((queue.Count > 1) && (TimeWindow > current.Subtract(queue.Peek()))) { queue.Dequeue(); } return(queue.Count); }
public void Update(url Url, timestamp Timestamp) { if (Url.Valid()) { Registry.Increment(Url.GetSection()); string outKey = KeyCache.Put(Url.GetSection()); if (outKey != null) { Registry.Remove(outKey); } } if (Timestamp.Valid()) { queue.Enqueue(Timestamp.GetValue()); } }