Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: mojo/public/c/system/time.h

Issue 1783623005: Add mojo/c/system/{time.h,wait.h}. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698