libkazv
time-util.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of libkazv.
3  * SPDX-FileCopyrightText: 2021 Tusooa Zhu <tusooa@kazv.moe>
4  * SPDX-License-Identifier: AGPL-3.0-or-later
5  */
6 
7 #pragma once
8 #include <libkazv-config.hpp>
9 
10 #include <chrono>
11 
12 #include <event.hpp>
13 
14 namespace Kazv
15 {
16  namespace detail
17  {
18  using ClockT = std::chrono::system_clock;
19  }
20 
22  {
23  auto now = detail::ClockT::now();
24  return std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
25  }
26 }
std::chrono::system_clock ClockT
Definition: time-util.hpp:18
Definition: location.hpp:10
std::int_fast64_t Timestamp
Definition: event.hpp:18
Timestamp currentTimeMs()
Definition: time-util.hpp:21