Skip to content
Discussion options

You must be logged in to vote

Because, as depicted in the tutorials and documentation, this is a single-threaded event-driven system. The timers run when the event manager runs, and if your event manager sleeps for 50ms, the smallest timer lapse you may have is 50ms, and 1/0.05 = 20
https://mongoose.ws/documentation/tutorials/webui-push/#backend-implementation-2 links to
http://mongoose.ws/documentation/tutorials/timers/#minimal-example , which states

It is important to keep the event manager polling timeout smaller than the timer interval, because timers are checked at every polling cycle. If there are no network events, the poll function would sleep for the whole polling interval and if it is larger than the timer …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by guangnian1126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants