get-universal-time-ms added
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "ml_date.h"
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
#include <chrono>
|
||||
|
||||
long now() { // get-universal-time
|
||||
time_t t = std::time(nullptr);
|
||||
@@ -10,6 +11,13 @@ long now() { // get-universal-time
|
||||
return now;
|
||||
}
|
||||
|
||||
long now_ms() { // get-universal-time-ms
|
||||
using namespace std::chrono;
|
||||
milliseconds ms = duration_cast< milliseconds >(system_clock::now().time_since_epoch());
|
||||
|
||||
return ms.count();
|
||||
}
|
||||
|
||||
long get_gmt_localtime_offset() {
|
||||
std::time_t current_time;
|
||||
std::time(¤t_time);
|
||||
|
||||
Reference in New Issue
Block a user