ambd: remove redundant code in core
[profile/ivi/automotive-message-broker.git] / lib / timestamp.h
1 #ifndef _TIMESTAMP_H___
2 #define _TIMESTAMP_H___
3
4 #include <time.h>
5
6 namespace amb {
7
8 double currentTime();
9
10 class Timestamp {
11 protected:
12         Timestamp();
13
14 public:
15
16         double currentTime();
17         double currentTime(double time);
18
19         double epochTime(double time);
20
21         double epochTime();
22
23     static double fromTimeval(const struct ::timeval& tv);
24     static struct ::timeval toTimeval(const double time);
25
26 public:
27         static Timestamp *instance();
28
29 private:
30         double startTimeEpoch;
31         static Timestamp* mInstance;
32 };
33
34 }
35
36 #endif