2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (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
8 * http://floralicense.org/license/
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.
17 #ifndef _CLOCK_MONOTONIC_H
18 #define _CLOCK_MONOTONIC_H
24 * @brief Check if platform supports all required clock types
26 * @return true if supported, false otherwise.
28 bool clock_is_supported();
31 * @brief Gets current time using monotonic clock
33 * @note the func will abort if monotonic clock is not supported.
34 * call @clock_is_supported beforehead to validate if platform
35 * supports all clock types.
37 * @return: seconds since unspecified time point.
39 float clock_monotonic_get();
42 * @brief Gets current time using realtime clock
44 * @note the func will abort if realtime clock is not supported.
45 * call @clock_is_supported beforehead to validate if platform
46 * supports all clock types.
48 * @return: number of seconds since Epoch
50 time_t clock_realtime_get();