Mercurial > hg > nginx
diff src/os/unix/ngx_time.c @ 0:4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
The first code that uses "ngx_" prefix, the previous one used "gx_" prefix.
At that point the code is not yet usable. The first draft ideas are dated
back to 23.10.2001.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 06 Aug 2002 16:39:45 +0000 |
parents | |
children | d220029ac7f3 |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/src/os/unix/ngx_time.c @@ -0,0 +1,19 @@ + +#include <ngx_config.h> +#include <ngx_time.h> + +void ngx_localtime(ngx_tm_t *tm) +{ + time_t clock = time(NULL); + localtime_r(&clock, tm); +} + +u_int ngx_msec(void) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); + + return tv.tv_sec * 1000 + tv.tv_usec / 1000; +} +