1 // Copyright 2018 The Fuchsia 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 
5 #pragma once
6 
7 #include <lib/async/time.h>
8 #include <lib/zx/time.h>
9 
10 namespace async {
11 
12 // Returns the current time in the dispatcher's timebase.
13 // For most loops, this is generally obtained from |ZX_CLOCK_MONOTONIC|
14 // but certain loops may use a different timebase, notably for testing.
Now(async_dispatcher_t * dispatcher)15 inline zx::time Now(async_dispatcher_t* dispatcher) {
16     return zx::time(async_now(dispatcher));
17 }
18 
19 } // namespace async
20