Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Initially: dequeue D of (timestamp, latency) pairs
  2.  
  3. new point (t, l):
  4. while true and not empty(D):
  5. (t', l') := last(D)
  6. if l > l'
  7. pop_last(D)
  8. else
  9. break
  10. append to tail
  11.  
  12. retrieve point:
  13. while not empty(D):
  14. (t, l) := first(D)
  15. if t < now - 30s:
  16. pop_first(D)
  17. else:
  18. return l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement