doc
c_time.h
Go to the documentation of this file.
1/*
2 * c_time - time functions
3 *
4 * Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef _C_TIME_H
22#define _C_TIME_H
23
24#include <time.h>
25#include <sys/time.h>
26
27/**
28 * @brief Calculate time difference
29 *
30 * The c_tspecdiff function returns the time elapsed between time time1 and time
31 * time0 represented as timespec.
32 *
33 * @param time1 The time.
34 * @param time0 The time.
35 *
36 * @return time elapsed between time1 and time0.
37 */
38struct timespec c_tspecdiff(struct timespec time1, struct timespec time0);
39
40/**
41 * @brief Calculate time difference.
42 *
43 * The function returns the time elapsed between time clock1 and time
44 * clock0 represented as double (in seconds and milliseconds).
45 *
46 * @param clock1 The time.
47 * @param clock0 The time.
48 *
49 * @return time elapsed between clock1 and clock0 in seconds and
50 * milliseconds.
51 */
52double c_secdiff(struct timespec clock1, struct timespec clock0);
53
54int c_utimes(const char *uri, const struct timeval *times);
55
56#endif /* _C_TIME_H */
int c_utimes(const char *uri, const struct timeval *times)
struct timespec c_tspecdiff(struct timespec time1, struct timespec time0)
Calculate time difference.
double c_secdiff(struct timespec clock1, struct timespec clock0)
Calculate time difference.