mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 20:08:21 +08:00
Optimize fiber's performance by decreasing the count of calling gettimeofday.
This commit is contained in:
parent
2bee91ca73
commit
389158b1a3
@ -523,7 +523,11 @@ int event_process(EVENT *ev, int timeout)
|
||||
// call the system event waiting API for any event arriving.
|
||||
ret = ev->event_wait(ev, timeout);
|
||||
|
||||
(void) event_set_stamp(ev); // reset the stamp after event waiting.
|
||||
// reset the stamp after event waiting only if timeout not 0 that
|
||||
// we can decrease the times of calling gettimeofday() API.
|
||||
if (timeout != 0) {
|
||||
(void) event_set_stamp(ev);
|
||||
}
|
||||
|
||||
#ifdef HAS_POLL
|
||||
event_process_poll(ev);
|
||||
|
Loading…
Reference in New Issue
Block a user