Nymph  v1.5.2
Flow-Based Data Processing Framework
KTTime.hh
Go to the documentation of this file.
1 /*
2  * KTTime.hh
3  *
4  * Created on: Oct 08, 2014
5  * Author: nsoblath
6  *
7  * Copied from libthorax's thorax_time.h
8  */
9 
10 #ifndef KTTIME_HH_
11 #define KTTIME_HH_
12 
13 #include <inttypes.h>
14 #include <sys/time.h>
15 #include <time.h>
16 
17 #ifndef NSEC_PER_SEC
18 #define NSEC_PER_SEC 1000000000
19 #endif
20 
21 #ifndef SEC_PER_NSEC
22 #define SEC_PER_NSEC 1.e-9
23 #endif
24 
25 #ifdef __MACH__
26 #include <mach/mach_time.h>
27 
28 #ifndef MACNANO
29 #define MACNANO (+1.0E-9)
30 #define MACGIGA UINT64_C(1000000000)
31 #endif // MACNANO
32 
33 extern double eTimebase;
34 extern uint64_t eTimestart;
35 #endif // __MACH__
36 
37 
38 extern char eDateTimeFormat[];
39 
40 
41 int GetTimeMonotonic(struct timespec* time);
42 
43 int GetTimeCurrent(struct timespec* time);
44 
45 uint64_t TimeToNSec(struct timespec time);
46 
47 double TimeToSec(struct timespec time);
48 
49 void TimeDiff(struct timespec start, struct timespec end, struct timespec* diff);
50 
51 size_t GetTimeAbsoluteStr(char* ptr);
52 
53 #endif // KTTIME_HH_
double TimeToSec(struct timespec time)
Definition: KTTime.cc:65
size_t GetTimeAbsoluteStr(char *ptr)
Definition: KTTime.cc:85
int GetTimeMonotonic(struct timespec *time)
Definition: KTTime.cc:19
char eDateTimeFormat[]
Definition: KTTime.cc:12
uint64_t TimeToNSec(struct timespec time)
Definition: KTTime.cc:60
int GetTimeCurrent(struct timespec *time)
Definition: KTTime.cc:39
void TimeDiff(struct timespec start, struct timespec end, struct timespec *diff)
Definition: KTTime.cc:70