Rate limiting library?

Global variables and threads points at SWI-Prolog -- Flags