From 54c174e56644c99ad190e1f29eb6ad8343666b8b Mon Sep 17 00:00:00 2001 From: twosee Date: Tue, 28 May 2019 15:13:18 +0800 Subject: [PATCH] Add constants for Timer. --- swoole_timer.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/swoole_timer.cc b/swoole_timer.cc index 45f8f820934..2f6b3bfd999 100644 --- a/swoole_timer.cc +++ b/swoole_timer.cc @@ -92,6 +92,11 @@ void swoole_timer_init(int module_number) SW_FUNCTION_ALIAS(&swoole_timer_ce->function_table, "list", CG(function_table), "swoole_timer_list"); SW_FUNCTION_ALIAS(&swoole_timer_ce->function_table, "clear", CG(function_table), "swoole_timer_clear"); SW_FUNCTION_ALIAS(&swoole_timer_ce->function_table, "clearAll", CG(function_table), "swoole_timer_clear_all"); + + SW_REGISTER_LONG_CONSTANT("SWOOLE_TIMER_MIN_MS", SW_TIMER_MIN_MS); + SW_REGISTER_DOUBLE_CONSTANT("SWOOLE_TIMER_MIN_SEC", SW_TIMER_MIN_SEC); + SW_REGISTER_LONG_CONSTANT("SWOOLE_TIMER_MAX_MS", SW_TIMER_MAX_MS); + SW_REGISTER_DOUBLE_CONSTANT("SWOOLE_TIMER_MAX_SEC", SW_TIMER_MAX_SEC); } static void php_swoole_timer_dtor(swTimer_node *tnode)