1*e1eccf28SAndroid Build Coastguard Worker# 2*e1eccf28SAndroid Build Coastguard Worker# Copyright (C) 2015 The Android Open Source Project 3*e1eccf28SAndroid Build Coastguard Worker# 4*e1eccf28SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 5*e1eccf28SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 6*e1eccf28SAndroid Build Coastguard Worker# You may obtain a copy of the License at 7*e1eccf28SAndroid Build Coastguard Worker# 8*e1eccf28SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 9*e1eccf28SAndroid Build Coastguard Worker# 10*e1eccf28SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 11*e1eccf28SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 12*e1eccf28SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*e1eccf28SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 14*e1eccf28SAndroid Build Coastguard Worker# limitations under the License. 15*e1eccf28SAndroid Build Coastguard Worker# 16*e1eccf28SAndroid Build Coastguard Worker 17*e1eccf28SAndroid Build Coastguard Workerheader: 18*e1eccf28SAndroid Build Coastguard Workersummary: Time Functions and Types 19*e1eccf28SAndroid Build Coastguard Workerdescription: 20*e1eccf28SAndroid Build Coastguard Worker The functions below can be used to tell the current clock time and the current 21*e1eccf28SAndroid Build Coastguard Worker system up time. It is not recommended to call these functions inside of a kernel. 22*e1eccf28SAndroid Build Coastguard Workerend: 23*e1eccf28SAndroid Build Coastguard Worker 24*e1eccf28SAndroid Build Coastguard Workertype: rs_time_t 25*e1eccf28SAndroid Build Coastguard Workersize: 32 26*e1eccf28SAndroid Build Coastguard Workersimple: int 27*e1eccf28SAndroid Build Coastguard Workersummary: Seconds since January 1, 1970 28*e1eccf28SAndroid Build Coastguard Workerdescription: 29*e1eccf28SAndroid Build Coastguard Worker Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on 30*e1eccf28SAndroid Build Coastguard Worker January 1, 1970, Coordinated Universal Time (UTC)). 31*e1eccf28SAndroid Build Coastguard Workerend: 32*e1eccf28SAndroid Build Coastguard Worker 33*e1eccf28SAndroid Build Coastguard Workertype: rs_time_t 34*e1eccf28SAndroid Build Coastguard Workersize: 64 35*e1eccf28SAndroid Build Coastguard Workersimple: long 36*e1eccf28SAndroid Build Coastguard Workerend: 37*e1eccf28SAndroid Build Coastguard Worker 38*e1eccf28SAndroid Build Coastguard Workertype: rs_tm 39*e1eccf28SAndroid Build Coastguard Workerstruct: 40*e1eccf28SAndroid Build Coastguard Workerfield: int tm_sec, "Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds." 41*e1eccf28SAndroid Build Coastguard Workerfield: int tm_min, "Minutes after the hour. This ranges from 0 to 59." 42*e1eccf28SAndroid Build Coastguard Workerfield: int tm_hour, "Hours past midnight. This ranges from 0 to 23." 43*e1eccf28SAndroid Build Coastguard Workerfield: int tm_mday, "Day of the month. This ranges from 1 to 31." 44*e1eccf28SAndroid Build Coastguard Workerfield: int tm_mon, "Months since January. This ranges from 0 to 11." 45*e1eccf28SAndroid Build Coastguard Workerfield: int tm_year, "Years since 1900." 46*e1eccf28SAndroid Build Coastguard Workerfield: int tm_wday, "Days since Sunday. This ranges from 0 to 6." 47*e1eccf28SAndroid Build Coastguard Workerfield: int tm_yday, "Days since January 1. This ranges from 0 to 365." 48*e1eccf28SAndroid Build Coastguard Workerfield: 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." 49*e1eccf28SAndroid Build Coastguard Workersummary: Date and time structure 50*e1eccf28SAndroid Build Coastguard Workerdescription: 51*e1eccf28SAndroid Build Coastguard Worker Data structure for broken-down time components. 52*e1eccf28SAndroid Build Coastguard Workerend: 53*e1eccf28SAndroid Build Coastguard Worker 54*e1eccf28SAndroid Build Coastguard Workerfunction: rsGetDt 55*e1eccf28SAndroid Build Coastguard Workerret: float, "Time in seconds." 56*e1eccf28SAndroid Build Coastguard Workersummary: Elapsed time since last call 57*e1eccf28SAndroid Build Coastguard Workerdescription: 58*e1eccf28SAndroid Build Coastguard Worker Returns the time in seconds since this function was last called in this script. 59*e1eccf28SAndroid Build Coastguard Workertest: none 60*e1eccf28SAndroid Build Coastguard Workerend: 61*e1eccf28SAndroid Build Coastguard Worker 62*e1eccf28SAndroid Build Coastguard Workerfunction: rsLocaltime 63*e1eccf28SAndroid Build Coastguard Workerret: rs_tm*, "Pointer to the output local time, i.e. the same value as the parameter local." 64*e1eccf28SAndroid Build Coastguard Workerarg: rs_tm* local, "Pointer to time structure where the local time will be stored." 65*e1eccf28SAndroid Build Coastguard Workerarg: const rs_time_t* timer, "Input time as a number of seconds since January 1, 1970." 66*e1eccf28SAndroid Build Coastguard Workersummary: Convert to local time 67*e1eccf28SAndroid Build Coastguard Workerdescription: 68*e1eccf28SAndroid Build Coastguard Worker Converts the time specified by timer into a @rs_tm structure that provides year, month, 69*e1eccf28SAndroid Build Coastguard Worker hour, etc. This value is stored at *local. 70*e1eccf28SAndroid Build Coastguard Worker 71*e1eccf28SAndroid Build Coastguard Worker This functions returns the same pointer that is passed as first argument. If the 72*e1eccf28SAndroid Build Coastguard Worker local parameter is NULL, this function does nothing and returns NULL. 73*e1eccf28SAndroid Build Coastguard Workertest: none 74*e1eccf28SAndroid Build Coastguard Workerend: 75*e1eccf28SAndroid Build Coastguard Worker 76*e1eccf28SAndroid Build Coastguard Workerfunction: rsTime 77*e1eccf28SAndroid Build Coastguard Workerret: rs_time_t, "Seconds since the Epoch, -1 if there's an error." 78*e1eccf28SAndroid Build Coastguard Workerarg: rs_time_t* timer, "Location to also store the returned calendar time." 79*e1eccf28SAndroid Build Coastguard Workersummary: Seconds since January 1, 1970 80*e1eccf28SAndroid Build Coastguard Workerdescription: 81*e1eccf28SAndroid Build Coastguard Worker Returns the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970). 82*e1eccf28SAndroid Build Coastguard Worker 83*e1eccf28SAndroid Build Coastguard Worker If timer is non-NULL, the result is also stored in the memory pointed to by 84*e1eccf28SAndroid Build Coastguard Worker this variable. 85*e1eccf28SAndroid Build Coastguard Workertest: none 86*e1eccf28SAndroid Build Coastguard Workerend: 87*e1eccf28SAndroid Build Coastguard Worker 88*e1eccf28SAndroid Build Coastguard Workerfunction: rsUptimeMillis 89*e1eccf28SAndroid Build Coastguard Workerret: int64_t, "Uptime in milliseconds." 90*e1eccf28SAndroid Build Coastguard Workersummary: System uptime in milliseconds 91*e1eccf28SAndroid Build Coastguard Workerdescription: 92*e1eccf28SAndroid Build Coastguard Worker Returns the current system clock (uptime) in milliseconds. 93*e1eccf28SAndroid Build Coastguard Workertest: none 94*e1eccf28SAndroid Build Coastguard Workerend: 95*e1eccf28SAndroid Build Coastguard Worker 96*e1eccf28SAndroid Build Coastguard Workerfunction: rsUptimeNanos 97*e1eccf28SAndroid Build Coastguard Workerret: int64_t, "Uptime in nanoseconds." 98*e1eccf28SAndroid Build Coastguard Workersummary: System uptime in nanoseconds 99*e1eccf28SAndroid Build Coastguard Workerdescription: 100*e1eccf28SAndroid Build Coastguard Worker Returns the current system clock (uptime) in nanoseconds. 101*e1eccf28SAndroid Build Coastguard Worker 102*e1eccf28SAndroid Build Coastguard Worker The granularity of the values return by this call may be much larger than a nanosecond. 103*e1eccf28SAndroid Build Coastguard Workertest: none 104*e1eccf28SAndroid Build Coastguard Workerend: 105