summaryrefslogtreecommitdiff
path: root/absl/time/internal/get_current_time_windows.inc
blob: 273d2d80e70ced185884d2de6daa974f6f258fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "absl/time/clock.h"

#include <chrono>
#include <cstdint>

namespace absl {
inline namespace lts_2018_06_20 {
namespace time_internal {

static int64_t GetCurrentTimeNanosFromSystem() {
  return std::chrono::duration_cast<std::chrono::nanoseconds>(
             std::chrono::system_clock::now() -
             std::chrono::system_clock::from_time_t(0))
      .count();
}

}  // namespace time_internal
}  // inline namespace lts_2018_06_20
}  // namespace absl