Scoop API

scoop:scoop.std:0.1.0

src/time/duration_units.scoop

Selected production source · src/time/duration_units.scoop

1package scoop.time
3/**
4 * Constructs an elapsed duration of this many nanoseconds with checked overflow.
5 */
6public fun Int.nanoseconds(): Duration = Duration.nanoseconds(toLong())
7/**
8 * Constructs an elapsed duration of this many nanoseconds with checked overflow.
9 */
10public fun Long.nanoseconds(): Duration = Duration.nanoseconds(this)
11/**
12 * Constructs an elapsed duration of this many microseconds with checked overflow.
13 */
14public fun Int.microseconds(): Duration = Duration.microseconds(toLong())
15/**
16 * Constructs an elapsed duration of this many microseconds with checked overflow.
17 */
18public fun Long.microseconds(): Duration = Duration.microseconds(this)
19/**
20 * Constructs an elapsed duration of this many milliseconds with checked overflow.
21 */
22public fun Int.milliseconds(): Duration = Duration.milliseconds(toLong())
23/**
24 * Constructs an elapsed duration of this many milliseconds with checked overflow.
25 */
26public fun Long.milliseconds(): Duration = Duration.milliseconds(this)
27/**
28 * Constructs an elapsed duration of this many seconds with checked overflow.
29 */
30public fun Int.seconds(): Duration = Duration.seconds(toLong())
31/**
32 * Constructs an elapsed duration of this many seconds with checked overflow.
33 */
34public fun Long.seconds(): Duration = Duration.seconds(this)
35/**
36 * Constructs an elapsed duration of this many minutes with checked overflow.
37 */
38public fun Int.minutes(): Duration = Duration.minutes(toLong())
39/**
40 * Constructs an elapsed duration of this many minutes with checked overflow.
41 */
42public fun Long.minutes(): Duration = Duration.minutes(this)
43/**
44 * Constructs an elapsed duration of this many hours with checked overflow.
45 */
46public fun Int.hours(): Duration = Duration.hours(toLong())
47/**
48 * Constructs an elapsed duration of this many hours with checked overflow.
49 */
50public fun Long.hours(): Duration = Duration.hours(this)
51/**
52 * Constructs an elapsed duration of this many days with checked overflow.
53 */
54public fun Int.days(): Duration = Duration.days(toLong())
55/**
56 * Constructs an elapsed duration of this many days with checked overflow.
57 */
58public fun Long.days(): Duration = Duration.days(this)