blob: bd31e0980500512f2295e989ddeb07ebc480a303 [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 Brouillet6386ceb2015-04-28 15:06:30 -070020 The functions below can be used to tell the current clock time and the current
21 system up time. It is not recommended to call these functions inside of a kernel.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070022end:
23
24type: rs_time_t
25size: 32
26simple: int
27summary: Seconds since January 1, 1970
28description:
29 Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on
30 January 1, 1970, Coordinated Universal Time (UTC)).
31end:
32
33type: rs_time_t
34size: 64
35simple: long
36end:
37
38type: rs_tm
39struct:
40field: int tm_sec, "Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds."
41field: int tm_min, "Minutes after the hour. This ranges from 0 to 59."
42field: int tm_hour, "Hours past midnight. This ranges from 0 to 23."
43field: int tm_mday, "Day of the month. This ranges from 1 to 31."
44field: int tm_mon, "Months since January. This ranges from 0 to 11."
45field: int tm_year, "Years since 1900."
46field: int tm_wday, "Days since Sunday. This ranges from 0 to 6."
47field: int tm_yday, "Days since January 1. This ranges from 0 to 365."
48field: 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."
49summary: Date and time structure
50description:
51 Data structure for broken-down time components.
52end:
53
54function: rsGetDt
55ret: float, "Time in seconds."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070056summary: Elapsed time since last call
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070057description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070058 Returns the time in seconds since this function was last called in this script.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070059test: none
60end:
61
62function: rsLocaltime
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070063ret: rs_tm*, "Pointer to the output local time, i.e. the same value as the parameter local."
64arg: rs_tm* local, "Pointer to time structure where the local time will be stored."
65arg: const rs_time_t* timer, "Input time as a number of seconds since January 1, 1970."
66summary: Convert to local time
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070067description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070068 Converts the time specified by timer into a @rs_tm structure that provides year, month,
69 hour, etc. This value is stored at *local.
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070070
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070071 This functions returns the same pointer that is passed as first argument. If the
72 local parameter is NULL, this function does nothing and returns NULL.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070073test: none
74end:
75
76function: rsTime
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070077ret: rs_time_t, "Seconds since the Epoch, -1 if there's an error."
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070078arg: rs_time_t* timer, "Location to also store the returned calendar time."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070079summary: Seconds since January 1, 1970
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070080description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070081 Returns the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970).
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070082
83 If timer is non-NULL, the result is also stored in the memory pointed to by
84 this variable.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070085test: none
86end:
87
88function: rsUptimeMillis
89ret: int64_t, "Uptime in milliseconds."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070090summary: System uptime in milliseconds
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070091description:
92 Returns the current system clock (uptime) in milliseconds.
93test: none
94end:
95
96function: rsUptimeNanos
97ret: int64_t, "Uptime in nanoseconds."
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070098summary: System uptime in nanoseconds
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070099description:
100 Returns the current system clock (uptime) in nanoseconds.
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -0700101
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -0700102 The granularity of the values return by this call may be much larger than a nanosecond.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700103test: none
104end: