Commit bc269446 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook Github Bot

HHWheelTimerBase: use different DEFAULT_TICK_INTERVAL values for milliseconds and microseconds

Summary: HHWheelTimerBase: use different DEFAULT_TICK_INTERVAL values for milliseconds and microseconds

Reviewed By: djwatson

Differential Revision: D14608368

fbshipit-source-id: 81ca30dead56e0ec954fce05c9f920e15dc20405
parent 0029def9
......@@ -40,8 +40,15 @@ namespace folly {
* start showing up in cpu perf. Also, it might not be possible to set
* tick interval less than 10ms on older kernels.
*/
template <class Duration>
int HHWheelTimerBase<Duration>::DEFAULT_TICK_INTERVAL = 10;
template <>
int HHWheelTimerBase<std::chrono::milliseconds>::DEFAULT_TICK_INTERVAL = 10;
/*
* An interval of 200usec will give us 200usec * WHEEL_SIZE^WHEEL_BUCKETS
* for the largest timeout possible, or about 9 days.
*/
template <>
int HHWheelTimerBase<std::chrono::microseconds>::DEFAULT_TICK_INTERVAL = 200;
template <class Duration>
HHWheelTimerBase<Duration>::Callback::Callback() {}
......
......@@ -343,11 +343,16 @@ class HHWheelTimerBase : private folly::AsyncTimeout,
}
};
// std::chrono::milliseconds
template <>
int HHWheelTimerBase<std::chrono::milliseconds>::DEFAULT_TICK_INTERVAL;
using HHWheelTimer = HHWheelTimerBase<std::chrono::milliseconds>;
extern template class HHWheelTimerBase<std::chrono::milliseconds>;
// std::chrono::microseconds
template <>
int HHWheelTimerBase<std::chrono::microseconds>::DEFAULT_TICK_INTERVAL;
template <>
void HHWheelTimerBase<std::chrono::microseconds>::scheduleTimeoutInternal(
std::chrono::microseconds timeout);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment