Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 98 lines (74 sloc) 2.482 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 type t
20 (* FIXME, abstract away the type? *)
21 type tm = Unix.tm
22
23 val now : unit -> t
24 val infinity : t
25
26 val process_utime : unit -> t
27 val process_stime : unit -> t
28 val process_cutime : unit -> t
29 val process_cstime : unit -> t
30
31 val gmtime : t -> tm
32 val localtime : t -> tm
33
34 val gmt_msec : t -> int
35 val gmt_sec : t -> int
36 val gmt_min : t -> int
37 val gmt_hour : t -> int
38 val gmt_mday : t -> int
39 val gmt_mon : t -> int
40 val gmt_year : t -> int
41 val gmt_wday : t -> int
42 val gmt_yday : t -> int
43 val gmt_isdst : t -> bool
44
45 val local_msec : t -> int
46 val local_sec : t -> int
47 val local_min : t -> int
48 val local_hour : t -> int
49 val local_mday : t -> int
50 val local_mon : t -> int
51 val local_year : t -> int
52 val local_wday : t -> int
53 val local_yday : t -> int
54 val local_isdst : t -> bool
55
56 val mktime : year:int -> month:int -> day:int -> h:int -> min:int -> sec:int -> ms:int -> t
57
58 (*
59 let bound = Chrono.bound
60 *)
61
62 val zero : t
63
64 val is_infinite : t -> bool
65 val is_positive : t -> bool
66
67 val add : t -> t -> t
68 val difference : t -> t -> t
69 val max : t -> t -> t
70 val min : t -> t -> t
71
72 val is_after : t -> t -> bool
73 val is_before : t -> t -> bool
74
75 val seconds_float : float -> t
76 val seconds : int -> t
77 val minutes : int -> t
78 val hours : int -> t
79 val days : int -> t
80 val milliseconds : int -> t
81
82 val in_seconds : t -> float
83 val in_milliseconds : t -> int
84
85 val of_unix_time : float -> t
86 val of_unix_time_inf : float -> t (* Will not wrap past max_int *)
87 val to_unix_time : t -> float
88
89 val round_to_sec : t -> t
90
91
92 (** This function returns a time measured with better than millisecond precision.
93
94 PLEASE BE AWARE, that the official type of date/time at MLstate is the type
95 [t] above. You should only use this function when you absolutely need
96 sub-millisecond precision AND when you know what you are doing. *)
97 val get_accurate_time : unit -> float
Something went wrong with that request. Please try again.