diff --git a/cpp/Time.cpp b/cpp/Time.cpp new file mode 100644 index 0000000..047767e --- /dev/null +++ b/cpp/Time.cpp @@ -0,0 +1,14 @@ +#include "Gedeng/Time.h" + +#include + +namespace Gedeng { + +unsigned long Time::get_time_ms() { + auto now = std::chrono::high_resolution_clock::now(); + auto now_ms = std::chrono::time_point_cast(now); + + return now_ms.time_since_epoch().count(); +} + +} \ No newline at end of file diff --git a/include/Gedeng.h b/include/Gedeng.h index 21fb816..2225a13 100644 --- a/include/Gedeng.h +++ b/include/Gedeng.h @@ -4,5 +4,6 @@ #include "Gedeng/Logger.h" #include "Gedeng/String.h" #include "Gedeng/Vector.h" +#include "Gedeng/Time.h" #include "Gedeng/EntryPoint.h" \ No newline at end of file diff --git a/include/Gedeng/Time.h b/include/Gedeng/Time.h new file mode 100644 index 0000000..aa5bb0d --- /dev/null +++ b/include/Gedeng/Time.h @@ -0,0 +1,10 @@ +#pragma once + +namespace Gedeng { + +class Time { +public: + static unsigned long get_time_ms(); +}; + +} // namespace Gedeng \ No newline at end of file