It pulls from the ngx core. The internal core saves a millisecond-precision value for the current time. See https://www.cryptobells.com/openresty-time-resolution-with-ffi-a-more-accurate-approach/ for a few more details on ngx time structs.
Nginx core doesn't update the cache every millisecond- that's the point if it being cached, to avoid an expensive syscall.
http://forum.nginx.org/list.php?2 might help
you can ask this questions to the nginx-gyus directly though
the forum, which is just a frontend to the nginx-mailinglist
On May 7, 2015 15:26, "Yichun Zhang (agentzh)" <age...@gmail.com> wrote:
> On Wed, Apr 22, 2015 at 7:31 PM, Aapo Talvensaari wrote:
> > I started to dig through nginx
> > sources, and found that this is actually configurable:
> > http://nginx.org/en/docs/ngx_core_module.html#timer_resolution
So the cache gets also updates for going on request if there is a new request coming on during the request processing, e.g. the time is updated (by the new events and also affects previously started but not finished ones when calling ngx.now etc.) also for requests that have already been started?