Deleted Added
full compact
time.9 (135366) time.9 (140140)
1.\" $NetBSD: time.9,v 1.1 1995/11/25 21:24:53 perry Exp $
2.\"
3.\" Copyright (c) 1994 Christopher G. Demetriou
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 15 unchanged lines hidden (view full) ---

24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31.\"
1.\" $NetBSD: time.9,v 1.1 1995/11/25 21:24:53 perry Exp $
2.\"
3.\" Copyright (c) 1994 Christopher G. Demetriou
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 15 unchanged lines hidden (view full) ---

24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31.\"
32.\" $FreeBSD: head/share/man/man9/time.9 135366 2004-09-17 07:24:18Z brooks $
32.\" $FreeBSD: head/share/man/man9/time.9 140140 2005-01-12 21:48:25Z ru $
33.\"
34.Dd September 17, 2004
35.Dt TIME 9
36.Os
37.Sh NAME
33.\"
34.Dd September 17, 2004
35.Dt TIME 9
36.Os
37.Sh NAME
38.In sys/time.h
39.Nm boottime ,
40.Nm time_second ,
41.Nm time_uptime
42.Nd system time variables
43.Sh SYNOPSIS
38.Nm boottime ,
39.Nm time_second ,
40.Nm time_uptime
41.Nd system time variables
42.Sh SYNOPSIS
44.Bl -item -compact
45.It
46.Va extern struct timeval boottime ;
47.It
48.Va extern struct time_t time_second ;
49.It
50.Va extern struct timeval time_uptime ;
51.El
43.In sys/time.h
44.Pp
45.Vt extern struct timeval boottime ;
46.Vt extern struct time_t time_second ;
47.Vt extern struct timeval time_uptime ;
52.Sh DESCRIPTION
53The
54.Va boottime
55variable holds the system boot time.
56.Pp
57The
58.Va time_second
59variable is the system's
60.Dq wall time
61clock to the second.
62.Pp
63The
48.Sh DESCRIPTION
49The
50.Va boottime
51variable holds the system boot time.
52.Pp
53The
54.Va time_second
55variable is the system's
56.Dq wall time
57clock to the second.
58.Pp
59The
64.Va time_uptime variable is the number of seconds since boot.
60.Va time_uptime
61variable is the number of seconds since boot.
65.Pp
66The
67.Xr bintime 9,
68.Xr getbintime 9 ,
69.Xr microtime 9 ,
70.Xr getmicrotime 9 ,
71.Xr nanotime 9 ,
72and
62.Pp
63The
64.Xr bintime 9,
65.Xr getbintime 9 ,
66.Xr microtime 9 ,
67.Xr getmicrotime 9 ,
68.Xr nanotime 9 ,
69and
73.Xr getnanotime 9 ,
70.Xr getnanotime 9
74functions can be used to get the current time more accurately and in an
75atomic manner.
76Similarly, the
77The
78.Xr binuptime 9,
79.Xr getbinuptime 9 ,
80.Xr microuptime 9 ,
81.Xr getmicrouptime 9 ,
82.Xr nanouptime 9 ,
83and
71functions can be used to get the current time more accurately and in an
72atomic manner.
73Similarly, the
74The
75.Xr binuptime 9,
76.Xr getbinuptime 9 ,
77.Xr microuptime 9 ,
78.Xr getmicrouptime 9 ,
79.Xr nanouptime 9 ,
80and
84.Xr getnanouptime 9 ,
81.Xr getnanouptime 9
85functions can be used to get the time elapse since boot more accurately
86and in an atomic manner.
87The
88.Va boottime
89variable may be read and written without special precautions.
82functions can be used to get the time elapse since boot more accurately
83and in an atomic manner.
84The
85.Va boottime
86variable may be read and written without special precautions.
90.Pp
91.Sh SEE ALSO
92.Xr clock_settime 2 ,
93.Xr ntp_adjtime 2 ,
94.Xr settimeofday 2 ,
95.Xr getbintime 9 ,
96.Xr getbinuptime 9 ,
97.Xr getmicrotime 9 ,
98.Xr getmicrouptime 9 ,
99.Xr getnanotime 9 ,
100.Xr getnanouptime 9 ,
101.Xr bintime 9 ,
102.Xr binuptime 9 ,
103.Xr microtime 9 ,
104.Xr microuptime 9 ,
105.Xr nanotime 9,
106.Xr nanouptime 9
107.Rs
108.%A "Poul-Henning Kamp"
109.%T "Timecounters: Efficient and precise timekeeping in SMP kernels"
87.Sh SEE ALSO
88.Xr clock_settime 2 ,
89.Xr ntp_adjtime 2 ,
90.Xr settimeofday 2 ,
91.Xr getbintime 9 ,
92.Xr getbinuptime 9 ,
93.Xr getmicrotime 9 ,
94.Xr getmicrouptime 9 ,
95.Xr getnanotime 9 ,
96.Xr getnanouptime 9 ,
97.Xr bintime 9 ,
98.Xr binuptime 9 ,
99.Xr microtime 9 ,
100.Xr microuptime 9 ,
101.Xr nanotime 9,
102.Xr nanouptime 9
103.Rs
104.%A "Poul-Henning Kamp"
105.%T "Timecounters: Efficient and precise timekeeping in SMP kernels"
110.%J "Proceedings of EuroBSDCon 2002"
111.%C "Amsterdam"
106.%J "Proceedings of EuroBSDCon 2002, Amsterdam"
112.%O /usr/share/doc/papers/timecounter.ascii.gz
113.Re
114.Rs
115.%A "Marshall Kirk McKusick"
116.%A "George V. Neville-Neil"
117.%B "The Design and Implementation of the FreeBSD Operating System"
118.%D "July 2004"
119.%I "Addison-Wesley"
120.%P "57-61,65-66"
121.Re
107.%O /usr/share/doc/papers/timecounter.ascii.gz
108.Re
109.Rs
110.%A "Marshall Kirk McKusick"
111.%A "George V. Neville-Neil"
112.%B "The Design and Implementation of the FreeBSD Operating System"
113.%D "July 2004"
114.%I "Addison-Wesley"
115.%P "57-61,65-66"
116.Re