Skip to content

Commit 284107d

Browse files
committed
Use more portable CLOCK_MONOTONIC
1 parent 6e56668 commit 284107d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tlc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ proceed_file(FILE *f, long long *lineno) {
269269
for (;;) {
270270
pfd[0].revents = 0;
271271
if (pt) {
272-
clock_gettime(CLOCK_UPTIME, &now);
272+
clock_gettime(CLOCK_MONOTONIC, &now);
273273
timespecsub(&next, &now, pt);
274274
if (timespeccmp(pt, &ts_zero, <))
275275
timespecclear(pt);
@@ -283,7 +283,7 @@ proceed_file(FILE *f, long long *lineno) {
283283
break;
284284
}
285285

286-
clock_gettime(CLOCK_UPTIME, &now);
286+
clock_gettime(CLOCK_MONOTONIC, &now);
287287
if (pt)
288288
timespecadd(&now, &interval, &next);
289289

@@ -358,7 +358,7 @@ main(int argc, char *argv[]) {
358358
if ((out_str = format_line(&out_str_len, lineno, "", 0)) == NULL)
359359
err(1, "format_line");
360360
display_line(out_str, out_str_len);
361-
clock_gettime(CLOCK_UPTIME, &now);
361+
clock_gettime(CLOCK_MONOTONIC, &now);
362362

363363
proceed_file(stdin, &lineno);
364364

0 commit comments

Comments
 (0)