Add Time helper class
This commit is contained in:
parent
1bb02f8e18
commit
eea3560b35
14
cpp/Time.cpp
Normal file
14
cpp/Time.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "Gedeng/Time.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace Gedeng {
|
||||
|
||||
unsigned long Time::get_time_ms() {
|
||||
auto now = std::chrono::high_resolution_clock::now();
|
||||
auto now_ms = std::chrono::time_point_cast<std::chrono::milliseconds>(now);
|
||||
|
||||
return now_ms.time_since_epoch().count();
|
||||
}
|
||||
|
||||
}
|
@ -4,5 +4,6 @@
|
||||
#include "Gedeng/Logger.h"
|
||||
#include "Gedeng/String.h"
|
||||
#include "Gedeng/Vector.h"
|
||||
#include "Gedeng/Time.h"
|
||||
|
||||
#include "Gedeng/EntryPoint.h"
|
10
include/Gedeng/Time.h
Normal file
10
include/Gedeng/Time.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
namespace Gedeng {
|
||||
|
||||
class Time {
|
||||
public:
|
||||
static unsigned long get_time_ms();
|
||||
};
|
||||
|
||||
} // namespace Gedeng
|
Loading…
x
Reference in New Issue
Block a user