blob: 5a4868489df49bd441e4e7bd096636adadb179e1 [file] [log] [blame]
Antonio Nino Diaz27989a82018-08-17 10:45:47 +01001/*
2 * Copyright (c) 2012-2017 Roberto E. Vargas Caballero
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
Antonio Nino Diaz7c0ff9c2018-08-15 19:51:09 +01006/*
7 * Portions copyright (c) 2018, ARM Limited and Contributors.
8 * All rights reserved.
9 */
Antonio Nino Diaz27989a82018-08-17 10:45:47 +010010
11#ifndef _TIME_H
12#define _TIME_H
13
Antonio Nino Diaz7c0ff9c2018-08-15 19:51:09 +010014#include <time_.h>
Antonio Nino Diaz27989a82018-08-17 10:45:47 +010015
16#ifndef NULL
17#define NULL ((void *) 0)
18#endif
19
20#define CLOCKS_PER_SEC 1000000
21
22typedef long int clock_t;
23
24struct tm {
25 int tm_sec;
26 int tm_min;
27 int tm_hour;
28 int tm_mday;
29 int tm_mon;
30 int tm_year;
31 int tm_wday;
32 int tm_yday;
33 int tm_isdst;
34};
35
36extern clock_t clock(void);
37extern double difftime(time_t time1, time_t time0);
38extern time_t mktime(struct tm *timeptr);
39extern time_t time(time_t *timer);
40extern char *asctime(const struct tm *timeptr);
41extern char *ctime(const time_t *timer);
42extern struct tm *gmtime(const time_t *timer);
43extern struct tm *localtime(const time_t *timer);
44extern size_t strftime(char * restrict s, size_t maxsize,
45 const char * restrict format,
46 const struct tm * restrict timeptr);
47
48#endif