Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cc3785952a205b1adb2c33af686ec4961239d0d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*******************************************************************************
 * Copyright (c) 2013 protos software gmbh (http://www.protos.de).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * CONTRIBUTORS:
 * 		Thomas Schuetz (initial contribution)
 *
 *******************************************************************************/

/**
 * \file etTime.h
 *
 * defines a generic interface for platform specific implementations of services around time
 *
 * \author Thomas Schuetz
 */

#ifndef _ETTIME_H_
#define _ETTIME_H_

#include "etDatatypes.h"

ET_EXTERN_C_BEGIN

/**
 * time definition composed by the number of seconds and the number of nano seconds
 * negative values have only negative sec, nSec is always positive
 * for nSec always holds and 0 <= nSec < 1E9 (1 second in nano seconds)
 * all functions in etTimeHelpers also have those preconditions
 */
typedef struct etTime {
	etInt32 sec;		/**< seconds */
	etInt32 nSec;		/**< nanoseconds */
} etTime;

/**
 * small time difference, typically as difference of etTime that only differ by a small amount of time.
 * Unit is nano seconds
 */
typedef etInt32 etTimeDiff;

/**
 * get current time from target hardware
 * this is no real world clock time and date
 * should be used only for relative time measurement
 * \param current target time as etTime*
 */
void getTimeFromTarget(etTime *t);

ET_EXTERN_C_END

#endif /* _ETTIME_H_ */

Back to the top