xref: /aosp_15_r20/hardware/ril/librilutils/librilutils.c (revision 062a843b36e31144e02d312b6b2de34642e6750e)
1*062a843bSAndroid Build Coastguard Worker /*
2*062a843bSAndroid Build Coastguard Worker  * Copyright (C) 2013 The Android Open Source Project
3*062a843bSAndroid Build Coastguard Worker  *
4*062a843bSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*062a843bSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*062a843bSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*062a843bSAndroid Build Coastguard Worker  *
8*062a843bSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*062a843bSAndroid Build Coastguard Worker  *
10*062a843bSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*062a843bSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*062a843bSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*062a843bSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*062a843bSAndroid Build Coastguard Worker  * limitations under the License.
15*062a843bSAndroid Build Coastguard Worker  */
16*062a843bSAndroid Build Coastguard Worker 
17*062a843bSAndroid Build Coastguard Worker #include <telephony/librilutils.h>
18*062a843bSAndroid Build Coastguard Worker #include <time.h>
19*062a843bSAndroid Build Coastguard Worker 
ril_nano_time()20*062a843bSAndroid Build Coastguard Worker uint64_t ril_nano_time() {
21*062a843bSAndroid Build Coastguard Worker     struct timespec now;
22*062a843bSAndroid Build Coastguard Worker     clock_gettime(CLOCK_MONOTONIC, &now);
23*062a843bSAndroid Build Coastguard Worker     return now.tv_sec * 1000000000LL + now.tv_nsec;
24*062a843bSAndroid Build Coastguard Worker }
25