rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 1 | .TH TIME 3 |
| 2 | .SH NAME |
| 3 | time, 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 |
| 11 | long time(long *tp) |
| 12 | .PP |
| 13 | .B |
| 14 | vlong nsec(void) |
| 15 | .SH DESCRIPTION |
| 16 | Both |
| 17 | .I time |
| 18 | and |
| 19 | .I nsec |
| 20 | return the time since the epoch 00:00:00 GMT, Jan. 1, 1970. |
| 21 | The return value of the former is in seconds and the latter in nanoseconds. |
| 22 | For |
| 23 | .IR time , |
| 24 | if |
| 25 | .I tp |
| 26 | is not zero then |
| 27 | .BI * tp |
| 28 | is also set to the answer. |
rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 29 | .SH SOURCE |
rsc | c3674de | 2005-01-11 17:37:33 +0000 | [diff] [blame] | 30 | .B \*9/src/lib9/time.c |
rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 31 | .SH DIAGNOSTICS |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 32 | These functions set |
rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 33 | .IR errstr . |
rsc | c8b6342 | 2005-01-13 04:49:19 +0000 | [diff] [blame] | 34 | .SH BUGS |
| 35 | To avoid name conflicts with the underlying system, |
| 36 | .I time |
| 37 | and |
| 38 | .I nsec |
| 39 | are preprocessor macros defined as |
| 40 | .I p9time |
| 41 | and |
| 42 | .IR p9nsec ; |
| 43 | see |
| 44 | .IR intro (3). |