blob: dfcafaf903046d294560149dc2c8b52d0a6b1335 [file] [log] [blame]
rsccfa37a72004-04-10 18:53:55 +00001.TH TIME 3
2.SH NAME
3time, nsec \- time in seconds and nanoseconds since epoch
4.SH SYNOPSIS
5.B #include <u.h>
6.br
7.B #include <libc.h>
8.PP
9.nf
10.B
11long time(long *tp)
12.PP
13.B
14vlong nsec(void)
15.SH DESCRIPTION
16Both
17.I time
18and
19.I nsec
20return the time since the epoch 00:00:00 GMT, Jan. 1, 1970.
21The return value of the former is in seconds and the latter in nanoseconds.
22For
23.IR time ,
24if
25.I tp
26is not zero then
27.BI * tp
28is also set to the answer.
rsccfa37a72004-04-10 18:53:55 +000029.SH SOURCE
rscc3674de2005-01-11 17:37:33 +000030.B \*9/src/lib9/time.c
rsccfa37a72004-04-10 18:53:55 +000031.SH DIAGNOSTICS
rsc058b0112005-01-03 06:40:20 +000032These functions set
rsccfa37a72004-04-10 18:53:55 +000033.IR errstr .
rscc8b63422005-01-13 04:49:19 +000034.SH BUGS
35To avoid name conflicts with the underlying system,
36.I time
37and
38.I nsec
39are preprocessor macros defined as
40.I p9time
41and
42.IR p9nsec ;
43see
44.IR intro (3).