Skip to content

Commit

Permalink
Merge branch 'elli89-bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
badaix committed Jul 2, 2015
2 parents f5dc912 + a146c8e commit 56ee9c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions common/timeDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace chronos
typedef std::chrono::microseconds usec;
typedef std::chrono::nanoseconds nsec;

static void addUs(timeval& tv, int us)
inline static void addUs(timeval& tv, int us)
{
if (us < 0)
{
Expand All @@ -46,22 +46,22 @@ namespace chronos
tv.tv_usec %= 1000000;
}

static long getTickCount()
inline static long getTickCount()
{
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
return now.tv_sec*1000 + now.tv_nsec / 1000000;
}

template <class Rep, class Period>
std::chrono::duration<Rep, Period> abs(std::chrono::duration<Rep, Period> d)
inline std::chrono::duration<Rep, Period> abs(std::chrono::duration<Rep, Period> d)
{
Rep x = d.count();
Rep x = d.count();
return std::chrono::duration<Rep, Period>(x >= 0 ? x : -x);
}

template <class ToDuration, class Rep, class Period>
int64_t duration(std::chrono::duration<Rep, Period> d)
inline int64_t duration(std::chrono::duration<Rep, Period> d)
{
return std::chrono::duration_cast<ToDuration>(d).count();
}
Expand Down

0 comments on commit 56ee9c1

Please sign in to comment.