44 lines · 753 B · Text
RawDownload
.TH TIME 2.SH NAMEtime, nsec \- time in seconds and nanoseconds since epoch.SH SYNOPSIS.B #include <u.h>.br.B #include <libc.h>.PP.nf.Blong time(long *tp).PP.Bvlong nsec(void).SH DESCRIPTIONBoth.I timeand.I nsecreturn the time since the epoch 00:00:00 GMT, Jan. 1, 1970.The return value of the former is in seconds and the latter in nanoseconds.For.IR time ,if.I tpis not zero then.BI * tpis also set to the answer..PPThese functions work by reading.BR /dev/bintime ,opening that file when they are first called..SH SOURCE.B /sys/src/libc/9sys/time.c.br.B /sys/src/libc/9sys/nsec.c.SH SEE ALSO.IR cputime (2),.IR cons (3).SH DIAGNOSTICSSets.IR errstr ..SH BUGSThese routines maintain a static file descriptor.