blob: f8f297d32a186c1ac000d7709b94e5c37e94017f [file] [log] [blame]
Jason Sams044e2ee2011-08-08 16:52:30 -07001/*
2 * Copyright (C) 2011 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
17/** @file rs_time.rsh
18 * \brief Time routines
19 *
20 *
21 */
22
Stephen Hinesca3f09c2011-01-07 15:11:30 -080023#ifndef __RS_TIME_RSH__
24#define __RS_TIME_RSH__
25
26typedef int rs_time_t;
27
28typedef struct {
29 int tm_sec;
30 int tm_min;
31 int tm_hour;
32 int tm_mday;
33 int tm_mon;
34 int tm_year;
35 int tm_wday;
36 int tm_yday;
37 int tm_isdst;
38} rs_tm;
39
40extern rs_time_t __attribute__((overloadable))
41 rsTime(rs_time_t *timer);
42
43extern rs_tm * __attribute__((overloadable))
44 rsLocaltime(rs_tm *local, const rs_time_t *timer);
45
46// Return the current system clock in milliseconds
47extern int64_t __attribute__((overloadable))
48 rsUptimeMillis(void);
49
50// Return the current system clock in nanoseconds
51extern int64_t __attribute__((overloadable))
52 rsUptimeNanos(void);
53
54// Return the time in seconds since function was last called in this script.
55extern float __attribute__((overloadable))
56 rsGetDt(void);
57
58#endif