提交 68207ef8 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Remove calls to uv_update_time(). As @saghul explained, libuv calls t at the…

Remove calls to uv_update_time(). As @saghul explained, libuv calls t at the beginning of each loop iteration.
NOTE: However, due to #59, we may have to completely remove usage of `uv_now()`.
上级 3aee6c55
......@@ -16,8 +16,6 @@ public:
private:
static uv_loop_t* loop;
static uint32_t maxTimeCounter;
static uint32_t timeUpdateCounter;
};
/* Inline static methods. */
......@@ -31,13 +29,6 @@ uv_loop_t* DepLibUV::GetLoop()
inline
uint64_t DepLibUV::GetTime()
{
// Update the libuv's concept of “now” every maxTimeCounter usages.
if (++DepLibUV::timeUpdateCounter == DepLibUV::maxTimeCounter)
{
DepLibUV::timeUpdateCounter = 0;
uv_update_time(DepLibUV::loop);
}
return uv_now(DepLibUV::loop);
}
......
......@@ -8,8 +8,6 @@
/* Static variables. */
uv_loop_t* DepLibUV::loop = nullptr;
uint32_t DepLibUV::maxTimeCounter = 16384;
uint32_t DepLibUV::timeUpdateCounter = 0;
/* Static methods. */
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论