mirror of
https://github.com/nmap/nmap.git
synced 2026-11-21 23:21:06 +00:00
Reduce frequency of timer callback
This commit is contained in:
parent
390c0b72fa
commit
04a035a0d3
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue