nanoMMO
0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
clock.h
Go to the documentation of this file.
1
#ifndef NANOMMO_PROTOCOL_CLOCK_H_
2
#define NANOMMO_PROTOCOL_CLOCK_H_
3
4
#include <chrono>
5
#include <cstdint>
6
7
namespace
nanommo
{
8
9
/// The system clock, not the steady one, so that a client can compare it
10
/// with its own, as long as their clocks agree.
11
inline
int64_t
NowMicros
() {
12
return
std::chrono::duration_cast<std::chrono::microseconds>(
13
std::chrono::system_clock::now().time_since_epoch())
14
.count();
15
}
16
17
}
// namespace nanommo
18
19
#endif
// NANOMMO_PROTOCOL_CLOCK_H_
nanommo
Definition
chat.cc:9
nanommo::NowMicros
int64_t NowMicros()
Definition
clock.h:11
protocol
clock.h
Generated by
1.15.0