blob: 208cced736e6da198b1d29c85d1d757bcc9c403b [file] [log] [blame]
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07001#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17header:
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070018summary: Time Functions and Types
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070019description:
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070020 The functions below can be used to tell the current clock time and the
21 current system up time. It's not recommended to call these functions
22 inside of a kernel.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070023end:
24
25type: rs_time_t
26size: 32
27simple: int
28summary: Seconds since January 1, 1970
29description:
30 Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on
31 January 1, 1970, Coordinated Universal Time (UTC)).
32end:
33
34type: rs_time_t
35size: 64
36simple: long
37end:
38
39type: rs_tm
40struct:
41field: int tm_sec, "Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds."
42field: int tm_min, "Minutes after the hour. This ranges from 0 to 59."
43field: int tm_hour, "Hours past midnight. This ranges from 0 to 23."
44field: int tm_mday, "Day of the month. This ranges from 1 to 31."
45field: int tm_mon, "Months since January. This ranges from 0 to 11."
46field: int tm_year, "Years since 1900."
47field: int tm_wday, "Days since Sunday. This ranges from 0 to 6."
48field: int tm_yday, "Days since January 1. This ranges from 0 to 365."
49field: int tm_isdst, "Flag to indicate whether daylight saving time is in effect. The value is positive if it is in effect, zero if it is not, and negative if the information is not available."
50summary: Date and time structure
51description:
52 Data structure for broken-down time components.
53end:
54
55function: rsGetDt
56ret: float, "Time in seconds."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070057summary: Elapsed time since last call
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070058description:
59 Returns the time in seconds since this function was last called in this
60 script.
61test: none
62end:
63
64function: rsLocaltime
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070065ret: rs_tm*, "Pointer to the output local time, i.e. the same value as the parameter local."
66arg: rs_tm* local, "Pointer to time structure where the local time will be stored."
67arg: const rs_time_t* timer, "Input time as a number of seconds since January 1, 1970."
68summary: Convert to local time
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070069description:
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070070 Converts the time specified by timer into a @rs_tm structure that provides year, month, hour, etc.
71 This value is stored at *local.
72
73 This functions returns the same pointer that is passed as first argument.
74 If the local parameter is NULL, this function does nothing and returns NULL.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070075test: none
76end:
77
78function: rsTime
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070079ret: rs_time_t, "Seconds since the Epoch, -1 if there's an error."
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070080arg: rs_time_t* timer, "Location to also store the returned calendar time."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070081summary: Seconds since January 1, 1970
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070082description:
83 Returns the number of seconds since the Epoch (00:00:00 UTC, January 1,
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070084 1970).
85
86 If timer is non-NULL, the result is also stored in the memory pointed to by
87 this variable.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070088test: none
89end:
90
91function: rsUptimeMillis
92ret: int64_t, "Uptime in milliseconds."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070093summary: System uptime in milliseconds
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070094description:
95 Returns the current system clock (uptime) in milliseconds.
96test: none
97end:
98
99function: rsUptimeNanos
100ret: int64_t, "Uptime in nanoseconds."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -0700101summary: System uptime in nanoseconds
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700102description:
103 Returns the current system clock (uptime) in nanoseconds.
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -0700104
105 The granularity of the values return by this call may be much
106 larger than a nanosecond.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700107test: none
108end: