From 04a035a0d37bb8417c6f925485a009d27fdfd3f7 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 2 Sep 2026 21:10:40 +0000 Subject: [PATCH] Reduce frequency of timer callback --- nse_main.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nse_main.cc b/nse_main.cc index 0928d07b8..f5d44278f 100644 --- a/nse_main.cc +++ b/nse_main.cc @@ -380,10 +380,12 @@ void timeout_hook(lua_State *L, lua_Debug *ar) { int install_thread_timer (lua_State *L) { + assert(L != L_NSE); lua_getfield(L, LUA_REGISTRYINDEX, NSE_TIMER); TimerState *timer_state = (TimerState *) lua_touserdata(L, -1); timer_state->start_time = time(NULL); - lua_sethook(L, timeout_hook, LUA_MASKCOUNT, 10000); + // 10M instructions should be more than 1/s but less than 100/s + lua_sethook(L, timeout_hook, LUA_MASKCOUNT, 10000000); return 0; }