Loading...
Searching...
No Matches
cs_time.h
1/*
2 * Copyright (c) 2014-2018 Cesanta Software Limited
3 * All rights reserved
4 *
5 * Licensed under the Apache License, Version 2.0 (the ""License"");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an ""AS IS"" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef CS_COMMON_CS_TIME_H_
19#define CS_COMMON_CS_TIME_H_
20
21#include <time.h>
22
23#include "platform.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif /* __cplusplus */
28
29/* Sub-second granularity time(). */
30double cs_time(void);
31
32/*
33 * Similar to (non-standard) timegm, converts broken-down time into the number
34 * of seconds since Unix Epoch.
35 */
36double cs_timegm(const struct tm* tm);
37
38#ifdef __cplusplus
39}
40#endif /* __cplusplus */
41
42#endif /* CS_COMMON_CS_TIME_H_ */