On Tue, Apr 14, 2009 at 11:23:24PM -0700, Haiping Zhao wrote:
 [...]
>  Anyways, I'll have to re-think our model. At the same time, may I
> ask why the change? Was that for calling gettimeofday() less number
> of times to be more efficient? But the code only updates
> base->tv_cache once per loop, each of which may take several
> milliseconds to finish. Doesn't that leave huge space for an
> inaccurate timestamp?

Adrian is right that the call can be expensive on some platforms.  But
you're right that sometimes timing accuracy matters more than
performance.  This would seem to be a great candidate for an event
base configuration flag in the 2.0.x series: there could be a new flag
in the event_base_config_flags enumeration to disable the timeval
cache.  Anybody want to code it up?

yrs,
-- 
Nick

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to