Moving headers into include/sls (#212)

This commit is contained in:
Erik Fröjdh
2020-11-02 16:05:28 +01:00
committed by GitHub
parent a57bbc084c
commit a15d8dd30a
199 changed files with 417 additions and 413 deletions

View File

@ -0,0 +1,22 @@
#pragma once
#include <chrono>
#include "sls/TypeTraits.h"
namespace sls {
namespace time {
using ns = std::chrono::nanoseconds;
using us = std::chrono::microseconds;
using ms = std::chrono::milliseconds;
using s = std::chrono::seconds;
// Absolute value of std::chrono::duration
template <class Rep, class Period>
constexpr std::chrono::duration<Rep, Period>
abs(std::chrono::duration<Rep, Period> d) {
return d >= d.zero() ? d : -d;
}
static_assert(sizeof(ns) == 8, "ns needs to be 64bit");
} // namespace time
} // namespace sls