Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / time.sig
1 (* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8 signature TIME =
9 sig
10 exception Time
11
12 type int = Pervasive.LargeInt.int
13
14 include ORDER
15
16 type times =
17 {
18 self: {utime: t, (* user time of process *)
19 stime: t (* system time of process *)
20 },
21 children: {utime: t, (* user time of terminated child processes *)
22 stime: t (* system time of terminated child processes *)
23 },
24 gc: {utime: t, (* user time of gc *)
25 stime: t (* system time of gc *)
26 }
27 }
28
29 val + : t * t -> t
30 val - : t * t -> t
31 val days: int -> t
32 val fromString: string -> t option
33 val fromMicroseconds: int -> t
34 val fromMilliseconds: int -> t
35 val fromReal: real -> t
36 val hours: int -> t
37 val minutes: int -> t
38 val now: unit -> t
39 val output: t * Out.t -> unit
40 val seconds: int -> t
41 val times: unit -> times
42 val timeThunk: (unit -> unit) -> t
43 val toMicroseconds: t -> int
44 val toMilliseconds: t -> int
45 val toReal: t -> real
46 val toSeconds: t -> int
47 val toString: t -> string
48 val weeks:int -> t
49 val years: int -> t
50 val zero: t
51 end