diff options
author | Igor Sysoev <igor@sysoev.ru> | 2002-08-06 16:39:45 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2002-08-06 16:39:45 +0000 |
commit | 6de5c2cb63f8aee4bcbec3c363a72fd8e4a4e64d (patch) | |
tree | 0e4da305f8101799b6c6aa3002cecf539c2578c0 /src/os/unix/ngx_time.c | |
download | nginx-6de5c2cb63f8aee4bcbec3c363a72fd8e4a4e64d.tar.gz nginx-6de5c2cb63f8aee4bcbec3c363a72fd8e4a4e64d.zip |
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.
Diffstat (limited to 'src/os/unix/ngx_time.c')
-rw-r--r-- | src/os/unix/ngx_time.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/os/unix/ngx_time.c b/src/os/unix/ngx_time.c new file mode 100644 index 000000000..d4be966dd --- /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; +} + |