可以嗎?
int TimeWheel::GenerateTimerID()
{
int x = rand() % 0xffffffff;
int cur_time = time(nullptr);
return x | cur_time | _timer_count;
}
int TimeWheel::AddTimer(int interval)
{
timer_id = GenerateTimerID();
_timer_count++;
return timer_id;
}