OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 |
| 5 // This file contains Mojo system time-related declarations/definitions. |
| 6 // |
| 7 // Note: This header should be compilable as C. |
| 8 |
| 9 #ifndef MOJO_PUBLIC_C_SYSTEM_TIME_H_ |
| 10 #define MOJO_PUBLIC_C_SYSTEM_TIME_H_ |
| 11 |
| 12 #include <stdint.h> |
| 13 |
| 14 // |MojoTimeTicks|: A time delta, in microseconds, the meaning of which is |
| 15 // source-dependent. |
| 16 |
| 17 typedef int64_t MojoTimeTicks; |
| 18 |
| 19 // |MojoDeadline|: Used to specify deadlines (timeouts), in microseconds (except |
| 20 // for |MOJO_DEADLINE_INDEFINITE|). |
| 21 // |MOJO_DEADLINE_INDEFINITE| - Used to indicate "forever". |
| 22 |
| 23 typedef uint64_t MojoDeadline; |
| 24 |
| 25 #define MOJO_DEADLINE_INDEFINITE ((MojoDeadline)-1) |
| 26 |
| 27 #ifdef __cplusplus |
| 28 extern "C" { |
| 29 #endif |
| 30 |
| 31 // Note: Pointer parameters that are labelled "optional" may be null (at least |
| 32 // under some circumstances). Non-const pointer parameters are also labeled |
| 33 // "in", "out", or "in/out", to indicate how they are used. (Note that how/if |
| 34 // such a parameter is used may depend on other parameters or the requested |
| 35 // operation's success/failure. E.g., a separate |flags| parameter may control |
| 36 // whether a given "in/out" parameter is used for input, output, or both.) |
| 37 |
| 38 // Returns the time, in microseconds, since some undefined point in the past. |
| 39 // The values are only meaningful relative to other values that were obtained |
| 40 // from the same device without an intervening system restart. Such values are |
| 41 // guaranteed to be monotonically non-decreasing with the passage of real time. |
| 42 // Although the units are microseconds, the resolution of the clock may vary and |
| 43 // is typically in the range of ~1-15 ms. |
| 44 MojoTimeTicks MojoGetTimeTicksNow(void); |
| 45 |
| 46 #ifdef __cplusplus |
| 47 } // extern "C" |
| 48 #endif |
| 49 |
| 50 #endif // MOJO_PUBLIC_C_SYSTEM_TIME_H_ |
OLD | NEW |