@@ -100,144 +100,4 @@ tag_t lf_delay_strict(tag_t tag, interval_t interval) {
100
100
result .microstep = UINT_MAX ;
101
101
}
102
102
return result ;
103
- }
104
-
105
- // instant_t lf_time_logical(void *env) { return ((Environment *)env)->current_tag.time; }
106
-
107
- // interval_t lf_time_logical_elapsed(void *env) { return lf_time_logical(env) - start_time; }
108
-
109
- // instant_t lf_time_physical(void) {
110
- // instant_t now = MSEC(0);
111
- // // Get the current clock value
112
- // return now;
113
- // }
114
-
115
- // instant_t lf_time_physical_elapsed(void) { return lf_time_physical() - start_time; }
116
-
117
- // instant_t lf_time_start(void) { return start_time; }
118
-
119
- // size_t lf_readable_time(char *buffer, instant_t time) {
120
- // if (time <= (instant_t)0) {
121
- // snprintf(buffer, 2, "0");
122
- // return 1;
123
- // }
124
- // char *original_buffer = buffer;
125
- // bool lead = false; // Set to true when first clause has been printed.
126
- // if (time > WEEKS(1)) {
127
- // lead = true;
128
- // size_t printed = lf_comma_separated_time(buffer, time / WEEKS(1));
129
- // time = time % WEEKS(1);
130
- // buffer += printed;
131
- // snprintf(buffer, 7, " weeks");
132
- // buffer += 6;
133
- // }
134
- // if (time > DAYS(1)) {
135
- // if (lead == true) {
136
- // snprintf(buffer, 3, ", ");
137
- // buffer += 2;
138
- // }
139
- // lead = true;
140
- // size_t printed = lf_comma_separated_time(buffer, time / DAYS(1));
141
- // time = time % DAYS(1);
142
- // buffer += printed;
143
- // snprintf(buffer, 3, " d");
144
- // buffer += 2;
145
- // }
146
- // if (time > HOURS(1)) {
147
- // if (lead == true) {
148
- // snprintf(buffer, 3, ", ");
149
- // buffer += 2;
150
- // }
151
- // lead = true;
152
- // size_t printed = lf_comma_separated_time(buffer, time / HOURS(1));
153
- // time = time % HOURS(1);
154
- // buffer += printed;
155
- // snprintf(buffer, 3, " h");
156
- // buffer += 2;
157
- // }
158
- // if (time > MINUTES(1)) {
159
- // if (lead == true) {
160
- // snprintf(buffer, 3, ", ");
161
- // buffer += 2;
162
- // }
163
- // lead = true;
164
- // size_t printed = lf_comma_separated_time(buffer, time / MINUTES(1));
165
- // time = time % MINUTES(1);
166
- // buffer += printed;
167
- // snprintf(buffer, 5, " min");
168
- // buffer += 4;
169
- // }
170
- // if (time > SECONDS(1)) {
171
- // if (lead == true) {
172
- // snprintf(buffer, 3, ", ");
173
- // buffer += 2;
174
- // }
175
- // lead = true;
176
- // size_t printed = lf_comma_separated_time(buffer, time / SECONDS(1));
177
- // time = time % SECONDS(1);
178
- // buffer += printed;
179
- // snprintf(buffer, 3, " s");
180
- // buffer += 2;
181
- // }
182
- // if (time > (instant_t)0) {
183
- // if (lead == true) {
184
- // snprintf(buffer, 3, ", ");
185
- // buffer += 2;
186
- // }
187
- // const char *units = "ns";
188
- // if (time % MSEC(1) == (instant_t)0) {
189
- // units = "ms";
190
- // time = time / MSEC(1);
191
- // } else if (time % USEC(1) == (instant_t)0) {
192
- // units = "us";
193
- // time = time / USEC(1);
194
- // }
195
- // size_t printed = lf_comma_separated_time(buffer, time);
196
- // buffer += printed;
197
- // snprintf(buffer, 4, " %s", units);
198
- // buffer += strlen(units) + 1;
199
- // }
200
- // return (buffer - original_buffer);
201
- // }
202
-
203
- // size_t lf_comma_separated_time(char *buffer, instant_t time) {
204
- // size_t result = 0; // The number of characters printed.
205
- // // If the number is zero, print it and return.
206
- // if (time == (instant_t)0) {
207
- // snprintf(buffer, 2, "0");
208
- // return 1;
209
- // }
210
- // // If the number is negative, print a minus sign.
211
- // if (time < (instant_t)0) {
212
- // snprintf(buffer, 2, "-");
213
- // buffer++;
214
- // result++;
215
- // }
216
- // int count = 0;
217
- // // Assume the time value is no larger than 64 bits.
218
- // instant_t clauses[7];
219
- // while (time > (instant_t)0) {
220
- // clauses[count++] = time;
221
- // time = time / 1000;
222
- // }
223
- // // Highest order clause should not be filled with zeros.
224
- // instant_t to_print = clauses[--count] % 1000;
225
- // snprintf(buffer, 5, "%lld", (long long)to_print);
226
- // if (to_print >= 100LL) {
227
- // buffer += 3;
228
- // result += 3;
229
- // } else if (to_print >= 10LL) {
230
- // buffer += 2;
231
- // result += 2;
232
- // } else {
233
- // buffer += 1;
234
- // result += 1;
235
- // }
236
- // while (count-- > 0) {
237
- // to_print = clauses[count] % 1000LL;
238
- // snprintf(buffer, 8, ",%03lld", (long long)to_print);
239
- // buffer += 4;
240
- // result += 4;
241
- // }
242
- // return result;
243
- // }
103
+ }
0 commit comments