pub const fn calculate_proportional_time_adjustment_ns(
last_refill_ns: u64,
elapsed_ns: u64,
window_ns: u64,
tokens_added: usize,
max_tokens: usize,
) -> u64Expand description
Calculate proportional time adjustment for nanosecond-based rate limiters
§Arguments
last_refill_ns- The last refresh time in nanosecondselapsed_ns- Nanoseconds elapsed since last refreshwindow_ns- Duration of the rate limiting window in nanosecondstokens_added- Number of tokens that were addedmax_tokens- Maximum number of tokens in the bucket
§Returns
The adjusted last refresh time in nanoseconds