File: time.tex

package info (click to toggle)
picolibc 1.8.11-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 50,064 kB
  • sloc: ansic: 404,031; asm: 24,984; sh: 2,585; python: 2,289; perl: 680; pascal: 329; exp: 287; makefile: 222; cpp: 71; xml: 40
file content (112 lines) | stat: -rw-r--r-- 3,328 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#
#Copyright (c) 1994 Cygnus Support.
#All rights reserved.
#
#Redistribution and use in source and binary forms are permitted
#provided that the above copyright notice and this paragraph are
#duplicated in all such forms and that any documentation,
#and/or other materials related to such
#distribution and use acknowledge that the software was developed
#at Cygnus Support, Inc.  Cygnus Support, Inc. may not be used to
#endorse or promote products derived from this software without
#specific prior written permission.
#THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
#IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
@node Timefns
@chapter Time Functions (@file{time.h})

This chapter groups functions used either for reporting on time
(elapsed, current, or compute time) or to perform calculations based
on time.

The header file @file{time.h} defines three types.  @code{clock_t} and
@code{time_t} are both used for representations of time particularly
suitable for arithmetic.  (In this implementation, quantities of type
@code{clock_t} have the highest resolution possible on your machine,
and quantities of type @code{time_t} resolve to seconds.)  @code{size_t}
is also defined if necessary for quantities representing sizes. 

@file{time.h} also defines the structure @code{tm} for the traditional
representation of Gregorian calendar time as a series of numbers, with
the following fields: 

@table @code
@item tm_sec
Seconds, between 0 and 60 inclusive (60 allows for leap seconds).

@item tm_min
Minutes, between 0 and 59 inclusive.

@item tm_hour
Hours, between 0 and 23 inclusive.

@item tm_mday
Day of the month, between 1 and 31 inclusive.

@item tm_mon
Month, between 0 (January) and 11 (December).

@item tm_year
Year (since 1900), can be negative for earlier years.

@item tm_wday
Day of week, between 0 (Sunday) and 6 (Saturday).

@item tm_yday
Number of days elapsed since last January 1, between 0 and 365 inclusive.

@item tm_isdst
Daylight Savings Time flag: positive means DST in effect, zero means DST
not in effect, negative means no information about DST is available.
Although for mktime(), negative means that it should decide if DST is in
effect or not.
@end table

@menu
* Function asctime::     Format time as string
* Function clock::       Cumulative processor time
* Function ctime::       Convert time to local and format as string
* Function difftime::    Subtract two times
* Function gmtime::      Convert time to UTC (GMT) traditional representation
* Function localtime::   Convert time to local representation
* Function mktime::      Convert time to arithmetic representation
* Function strftime::    Convert date and time to a user-formatted string
* Function time::        Get current calendar time (as single number)
* Function __tz_lock::   Lock time zone global variables
* Function tzset::       Set timezone info
@end menu

@page
@include time/asctime.def

@page
@include time/clock.def

@page
@include time/ctime.def

@page
@include time/difftime.def

@page
@include time/gmtime.def

@page
@include time/lcltime.def

@page
@include time/mktime.def

@page
@include time/strftime.def

@page
@include time/time.def

@page
@include time/tzlock.def

@page
@include time/tzset.def