I called the emit method of socket in the loop to send events to the front end, and sleep each loop for 1 second. However, in the course of testing, it is found that the front end is cumulative to handle these events. For example, I looped 10 times, and instead of responding to an event every second, the front end processed the cumulative 10 responses together at the end of the final loop.