Create a function that limits how often another function can execute. When called repeatedly, the function should only execute once per specified time interval, ignoring calls made within that interval.
Examples
Input:[["log",100],"call1"]
Output:"function"
Input:[["expensive",50],"a"]
Output:"function"
Hints
Track whether the function is currently in a cooldown period using a flag or timestamp.
When the throttled function is called during cooldown, ignore the call.
When the cooldown expires, allow the next call to execute.
Throttle
Implement a function to control execution by limiting how many times it can execute over a period.