harfang3d/harfang/foundation/time.cpp
2021-10-13 14:40:31 +02:00

16 lines
604 B
C++

// HARFANG(R) Copyright (C) 2021 Emmanuel Julien, NWNC HARFANG. Released under GPL/LGPL/Commercial Licence, see licence.txt for details.
#include "foundation/time.h"
#include <chrono>
#include <limits>
namespace hg {
time_ns time_undefined = std::numeric_limits<time_ns>::min();
time_ns time_now() { return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); }
time_ns wall_clock() { return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count(); }
} // namespace hg