mirror of
https://github.com/harfang3d/harfang3d.git
synced 2024-06-01 14:02:16 +00:00
16 lines
604 B
C++
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
|