src/BucketTimer.cpp
// cascades all vectors and executes all expired timer
cascades all vectors and executes all expired timer
cascades all vectors and executes all expired timer
int BucketTimer::Update(int64_t nowms)
{
    if (nowms == 0)
        nowms = Clock::CurrentTimeUnits();
    const auto jiffies = nowms / TIME_UNIT;
    auto runs = executs_;
    for (auto j = jiffies_; j < jiffies; j++) {
        const size_t slot = (size_t)(j % TVR_SIZE);
        if (near_[slot].size() > 0) {
            timerId_ += near_[slot].bucket_count();
            tick(near_[slot]);
        }
        jiffies_ ++;
    }
    return executs_ - runs;
}
int BucketTimer :: Update ( int64_t nowms ) { if ( nowms == 0 ) nowms = Clock :: CurrentTimeUnits ( ) ; const auto jiffies = nowms / TIME_UNIT ; auto runs = executs_ ; for ( auto j = jiffies_ ; j < jiffies ; j ++ ) { const size_t slot = ( size_t ) ( j % TVR_SIZE ) ; if ( near_ [ slot ] . size ( ) > 0 ) { timerId_ += near_ [ slot ] . bucket_count ( ) ; tick ( near_ [ slot ] ) ; } jiffies_ ++ ; } return executs_ - runs ; }
cascades all vectors and executes all expired timer
cascades all vectors and executes all expired timer