src/tcpkali_pacefier.h
static inline double
pacefier_when_allowed(struct pacefier *p, double now,
                      size_t need_events) {
    double elapsed = now - p->previous_ts;
    double move_events = elapsed * p->events_per_second;
    if(move_events >= need_events) {
        return 0.0;
    } else {
        return (need_events - move_events) / p->events_per_second;
    }
}
/*
 * Get the delay until the time we're allowed to move (need_events).
 */
Get the delay until the time we're allowed to move (need_events).
Get the delay until the time we ' re allowed to move ( need_events ) .
static inline double
pacefier_when_allowed(struct pacefier *p, double now,
                      size_t need_events) {
    double elapsed = now - p->previous_ts;
    double move_events = elapsed * p->events_per_second;
    if(move_events >= need_events) {
        return 0.0;
    } else {
        return (need_events - move_events) / p->events_per_second;
    }
}
static inline double pacefier_when_allowed ( struct pacefier * p , double now , size_t need_events ) { double elapsed = now - p -> previous_ts ; double move_events = elapsed * p -> events_per_second ; if ( move_events >= need_events ) { return 0.0 ; } else { return ( need_events - move_events ) / p -> events_per_second ; } }
Get the delay until the time we're allowed to move (need_events).
Get the delay until the time we ' re allowed to move ( need_events ) .