blob: 54497dd2fb89a94f079eb65f152ff8d72c9641b1 [file] [log] [blame]
btolsch5292c942018-07-26 00:06:22 -07001// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
btolsch9d6900c2018-05-30 18:22:53 -07005#include "platform/api/time.h"
6
7#include <chrono>
8
9namespace openscreen {
10namespace platform {
11
btolsch5292c942018-07-26 00:06:22 -070012TimeDelta GetMonotonicTimeNow() {
13 return TimeDelta::FromMicroseconds(
14 std::chrono::duration_cast<std::chrono::microseconds>(
15 std::chrono::steady_clock::now().time_since_epoch())
16 .count());
17}
18
19TimeDelta GetUTCNow() {
20 return GetMonotonicTimeNow();
btolsch9d6900c2018-05-30 18:22:53 -070021}
22
23} // namespace platform
24} // namespace openscreen