lokinet/llarp/util/time.hpp
Jeff Becker 95cd275cdd
liblokinet additions:
* add lokinet_add_bootstrap_rc function for adding an rc from memory
* prevent stack overflow on error closing connection in quic
* add in memory nodedb
* refactor how convotags are set as active
* add initial stubs for endpoint statistics
* refactor time stuff to be a bit cleaner
* update lnproxy script with more arguments
2021-04-19 06:59:07 -04:00

30 lines
509 B
C++

#pragma once
#include "types.hpp"
#include <nlohmann/json.hpp>
#include <iostream>
using namespace std::chrono_literals;
namespace llarp
{
/// get time right now as milliseconds, this is monotonic
Duration_t
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);
} // namespace llarp