2018-03-21 22:18:13 -04:00
|
|
|
//
|
|
|
|
// TimeTypes.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 21/03/2018.
|
2018-05-13 15:19:52 -04:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-03-21 22:18:13 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef TimeTypes_h
|
|
|
|
#define TimeTypes_h
|
|
|
|
|
2020-02-09 21:44:55 -05:00
|
|
|
#include <chrono>
|
|
|
|
|
2018-03-21 22:18:13 -04:00
|
|
|
namespace Time {
|
|
|
|
|
|
|
|
typedef double Seconds;
|
2020-02-09 21:44:55 -05: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-21 22:18:13 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* TimeTypes_h */
|