From 16cbeab4cf0ab9b0ea1e8d211b14572b12fab3a5 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Oct 25 2021 03:52:54 +0000 Subject: timers --- diff --git a/common.cpp b/common.cpp index edfe258..91cd471 100644 --- a/common.cpp +++ b/common.cpp @@ -1,5 +1,8 @@ #include +#include + +#include #include "common.h" @@ -9,3 +12,11 @@ void Address::print() const { printf("%hhu.%hhu.%hhu.%hhu:%hu", ip[0], ip[1], ip[2], ip[3], port); } +Time monotonicTime() { + return std::chrono::duration_cast( + std::chrono::steady_clock::now().time_since_epoch() ).count(); +} + + +Time globalTime() + { return time(NULL)*1000000ull; }