2018-03-22 02:18:13 +00:00
|
|
|
//
|
|
|
|
// TimeTypes.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 21/03/2018.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-03-22 02:18:13 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef TimeTypes_h
|
|
|
|
#define TimeTypes_h
|
|
|
|
|
2020-02-10 02:44:55 +00:00
|
|
|
#include <chrono>
|
|
|
|
|
2018-03-22 02:18:13 +00:00
|
|
|
namespace Time {
|
|
|
|
|
|
|
|
typedef double Seconds;
|
2020-02-10 02:44:55 +00:00
|
|
|
typedef int64_t Nanos;
|
|
|
|
|
|
|
|
inline Nanos nanos_now() {
|
|
|
|
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
|
|
|
|
}
|
2018-03-22 02:18:13 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* TimeTypes_h */
|