/
units.jl
129 lines (93 loc) 路 2.73 KB
/
units.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#####
##### Convenient definitions
#####
"""
second
A `Float64` constant equal to 1.0. Useful for increasing the clarity of scripts, e.g. `螖t = 1second`.
"""
const second = 1.0
"""
seconds
A `Float64` constant equal to 1.0. Useful for increasing the clarity of scripts, e.g. `螖t = 7seconds`.
"""
const seconds = second
"""
minute
A `Float64` constant equal to 60`seconds`. Useful for increasing the clarity of scripts, e.g. `螖t = 1minute`.
"""
const minute = 60seconds
"""
minutes
A `Float64` constant equal to 60`seconds`. Useful for increasing the clarity of scripts, e.g. `螖t = 15minutes`.
"""
const minutes = minute
"""
hour
A `Float64` constant equal to 60`minutes`. Useful for increasing the clarity of scripts, e.g. `螖t = 1hour`.
"""
const hour = 60minutes
"""
hours
A `Float64` constant equal to 60`minutes`. Useful for increasing the clarity of scripts, e.g. `螖t = 3hours`.
"""
const hours = hour
"""
day
A `Float64` constant equal to 24`hours`. Useful for increasing the clarity of scripts, e.g. `stop_time = 1day`.
"""
const day = 24hours
"""
days
A `Float64` constant equal to 24`hours`. Useful for increasing the clarity of scripts, e.g. `stop_time = 7days`.
"""
const days = day
"""
year
A `Float64` constant equal to 365`days`. Useful for increasing the clarity of scripts, e.g. `stop_time = 1year`.
"""
const year = 365days
"""
years
A `Float64` constant equal to 365`days`. Useful for increasing the clarity of scripts, e.g. `stop_time = 100years`.
"""
const years = year
"""
meter
A `Float64` constant equal to 1.0. Useful for increasing the clarity of scripts, e.g. `Lx = 1meter`.
"""
const meter = 1.0
"""
meters
A `Float64` constant equal to 1.0. Useful for increasing the clarity of scripts, e.g. `Lx = 50meters`.
"""
const meters = meter
"""
kilometer
A `Float64` constant equal to 1000`meters`. Useful for increasing the clarity of scripts, e.g. `Lx = 1kilometer`.
"""
const kilometer = 1000meters
"""
kilometers
A `Float64` constant equal to 1000`meters`. Useful for increasing the clarity of scripts, e.g. `Lx = 5000kilometers`.
"""
const kilometers = kilometer
"""
KiB
A `Float64` constant equal to 1024.0. Useful for increasing the clarity of scripts, e.g. `max_filesize = 250KiB`.
"""
const KiB = 1024.0
"""
MiB
A `Float64` constant equal to 1024`KiB`. Useful for increasing the clarity of scripts, e.g. `max_filesize = 100MiB`.
"""
const MiB = 1024KiB
"""
GiB
A `Float64` constant equal to 1024`MiB`. Useful for increasing the clarity of scripts, e.g. `max_filesize = 50GiB`.
"""
const GiB = 1024MiB
"""
TiB
A `Float64` constant equal to 1024`GiB`. Useful for increasing the clarity of scripts, e.g. `max_filesize = 2TiB`.
"""
const TiB = 1024GiB