lokinet/llarp/util/time.hpp

30 lines
509 B
C++
Raw Normal View History

#pragma once
2018-10-08 11:56:40 +00:00
#include "types.hpp"
#include <nlohmann/json.hpp>
#include <iostream>
2018-11-19 22:45:37 +00:00
2020-02-24 19:40:45 +00:00
using namespace std::chrono_literals;
2018-10-08 11:56:40 +00:00
namespace llarp
{
/// get time right now as milliseconds, this is monotonic
Duration_t
2018-11-19 22:45:37 +00:00
time_now_ms();
/// get the uptime of the process
Duration_t
uptime();
/// convert to milliseconds
uint64_t
ToMS(Duration_t duration);
std::ostream&
operator<<(std::ostream& out, const Duration_t& t);
nlohmann::json
to_json(const Duration_t& t);
2018-11-19 22:45:37 +00:00
} // namespace llarp