2 // Copyright (c) 2010-2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
29 Timestamp(const uint64_t sec, const uint64_t nsec) : m_sec(sec), m_nsec(nsec) {}
31 Timestamp(const struct timeval& tv) : m_sec(tv.tv_sec), m_nsec(tv.tv_usec) {}
32 Timestamp operator-(const Timestamp& other) const;
33 bool operator==(const Timestamp &other) const;
34 friend double operator/(double d, const Timestamp &denominator);
35 bool operator>(const Timestamp& other);
36 bool operator<(const Timestamp& other);
37 uint64_t sec() const {return m_sec;}
38 uint64_t nsec() const {return m_nsec;}
39 friend ostream& operator<<(ostream& stream, const Timestamp& ts);
45 #endif /* _TIMESTAMP_H_ */